求助

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

steelseries @ 2023-07-29 11:02:51

为啥一分没有,在线等,急

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a[12]={0},s=0;
    n+=30;
    for(int i=0;i<10;i++){
        cin>>a[i];
    }
    cin>>n;
    n+=30;
    for(int i=0;i<10;i++){
        if(a[i]>=n)
            s++;
    }
    cout<<s;
    return 0; 
} 

by dthythxth_Huge_Brain @ 2023-07-29 11:09:28

@kristopher 实际上你把

if(a[i]>=n)

改成<=就AC啦


by steelseries @ 2023-07-29 11:13:47

谢谢,是我眼瞎了(


by steelseries @ 2023-07-29 11:14:57

此贴结(谢谢大家对我的帮助)


|