样例不对,求助

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

paulyan @ 2024-08-07 19:01:03


#include <iostream> 
using namespace std;
int apple[1005];
int main(){
    for(int i=0;i<10;i++){
        cin>>apple[i];
    }
    int n,i=0;
    int cnt=0;
    while(cin>>n){
        if(n<apple[i]){
            n+=30;
        }
        if(n>=apple[i]){
            cnt++;
        }
    }
    cout<<cnt;
    return 0;   
}

by Hayase_Yuka @ 2024-08-07 19:09:13

#include<iostream>
using namespace std;
int main()
{
    int a[11],n,s=0;
    for(int i=1;i<=10;i++)
    {
        cin>>a[i];
    }
    cin>>n;
    for(int j=1;j<=10;j++)
    {
        if(n+30>=a[j])
          s++;
    }
    cout<<s;
    return 0; 
}

@paulyan


by paulyan @ 2024-08-07 19:41:34

@Hayase_Yuka 谢谢哈,能壶关吗


by paulyan @ 2024-08-07 20:05:53

@Hayase_Yuka 是互关


by Hayase_Yuka @ 2024-08-07 20:37:06

@paulyan 可以


by LEZ2012 @ 2024-08-09 20:07:00


#include<cstdio>
using namespace std;
int a[11],n,s=0;
int main(){
    for(int i=1;i<=10;i++)
    scanf("%d",&a[i]);
    scanf("%d",&n);
    for(int i=1;i<=10;i++)
    if(n+30>=a[i])
    s++; 
    printf("%d",s);
}

by LEZ2012 @ 2024-08-09 20:07:47

能互关吗?


by Wang20280214 @ 2024-08-18 21:01:09

@LEZ2012 咱两 互关呗


by Enmin @ 2024-08-24 16:35:05

@Wang20280214 我们全部人都壶关呗


|