C最后一个点wa了,求助!!!

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

Ailone @ 2023-11-17 11:47:42

#include <stdio.h>
int main()
{
    int n[10];
    int tall;
    int a=0;
    scanf("%d %d %d %d %d %d %d %d %d %d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5],&n[6],&n[7],&n[8],&n[9]);
    scanf("%d",&tall);
    for(int i=0;i<10;i++)
    {
        if(tall+30>n[i])
        a++;
    }
    printf("%d",a);
    return 0;
}

by SkyArbutus @ 2023-11-17 12:46:41

@Ailone 题目有一句:“假设她碰到苹果,苹果就会掉下来。” if里可能是>=


by Ailone @ 2023-11-17 15:28:33

@SkyArbutus 解决啦,谢谢awa


|