rookiepush @ 2017-05-26 20:10:20
#include<iostream>
using namespace std;
int main()
{
int a[11],n,i,k=0;
for(i=1;i<=10;i++)
cin>>a[i];
cin>>n;
for(i=1;i<=10;i++)
{
if(a[i]>n+30)
k++;
}
cout<<k;
}
by FP·荷兰猪 @ 2017-05-26 20:25:26
把 if(a[i]>n+30) 改成 if(a[i]<=n+30)试试
by FP·荷兰猪 @ 2017-05-26 20:25:45
#include<iostream>
using namespace std;
int main()
{
int a[11],n,i,k=0;
for(i=1;i<=10;i++)
cin>>a[i];
cin>>n;
for(i=1;i<=10;i++)
{
if(a[i]<=n+30)
k++;
}
cout<<k;
}
by 郭浩南 @ 2017-06-18 20:34:05
因为a[i]>n+30中应该是啊n+30>=a[i];