为啥错了呀,求助

P1046 [NOIP2005 普及组] 陶陶摘苹果

little_Aiz @ 2019-11-16 16:43:01

#include<iostream>
using namespace std;
int main()
{
    int a[11],count;
    for(int i=1;i<9;i++)
    {
        cin>>a[i];
    }
    int n;
    cin>>n;
    for(int i=1;i<9;i++)
    {
        if(a[i]<=n+30)
        {
            count++;
        }
    }
    cout<<count<<endl;
} 

by ShallowDream雨梨 @ 2019-11-16 16:44:37

9? 确定不是10?


by little_Aiz @ 2019-11-16 16:45:56

@ShallowDream雨梨 i=1啊


by ShallowDream雨梨 @ 2019-11-16 16:59:41

@little_Aiz 所以i从1到8?只输入8个数吗。。。


by JianFeng_Luogu @ 2019-11-17 15:54:10

@ShallowDream雨梨 嗯


|