第12行应该是 if(a[i]<=b)
by Keyong @ 2017-07-18 07:01:46
是
by cwtcwt @ 2017-07-19 11:43:57
```cpp
#include<iostream>
using namespace std;
int main()
{
int a[10],b,c=0,i;
for(i=0;i<=9;i++)
cin>>a[i];
cin>>b;
b+=30;
for(i=0;i<=9;i++)
{
if(a[i]<=b)
c++;
}
cout<<c;
return 0;
}
```
by 玲静 @ 2017-07-19 19:19:03
```cpp
#include<iostream>
using namespace std;
int main()
{
int a[10],b,c=0,i;
for(i=0;i<=9;i++)
cin>>a[i];
cin>>b;
b+=30;
for(i=0;i<=9;i++)
{
if(a[i]<=b)
c++;
}
cout<<c;
return 0;
}
```
by 大主宰 @ 2017-07-19 21:23:21
这是不是等于发答案
by WH1KI9RAVE @ 2017-07-22 10:50:39
@[Yhy9630](/space/show?uid=29226) 谢谢
by Mirror丶无风 @ 2017-07-26 07:54:47
@[大主宰](/space/show?uid=42542) 谢谢
by Mirror丶无风 @ 2017-07-26 07:55:09
@[玲静](/space/show?uid=47925) 谢谢
by Mirror丶无风 @ 2017-07-26 07:55:26
```cpp
#include<iomanip>
#include<iostream>
#include<ctime>
#include<cmath>
#include<cstring>
using namespace std;
int b;
int a[10];
double dist;
int trsf=1;
int main()
{
while(trsf<=10){
cin>>a[trsf];
++trsf;
}
trsf=1;
cin>>b;
b=b+30;
while(trsf<=10){
if(a[trsf]<=b)
dist++;
++trsf;
}
cout<<dist;
return 0;
}
能看一下怎么错了吗?谢谢
```
by Terrie @ 2017-07-30 16:05:34
@ Terry2005 int a[10]是定义了十个变量a[0]到a[9],应该把int a[10]改为int a[11],或者while循环时把0赋值给trsf,把trsf<=10改为trsf<10即可。
by ezoiHQM @ 2017-08-03 07:33:48