ETO1 @ 2024-11-08 19:22:01
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a[10],b,c,i,x;
scanf("%d %d %d %d %d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9]);
scanf("%d",&b);
c=b+30;
for(i=0;i<10;i++)
{
if(a[i]<c)
x++;
}
printf("%d",x);
return 0;
}
by __FL__ @ 2024-11-08 19:26:56
if(a[i]<=c)
假设她碰到苹果,苹果就会掉下来。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a[10],b,c,i,x=0;
scanf("%d %d %d %d %d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9]);
scanf("%d",&b);
c=b+30;
for(i=0;i<10;i++)
{
if(a[i]<=c)
x++;
}
printf("%d",x);
return 0;
}
by __FL__ @ 2024-11-08 19:37:56
@ETO1
by flyingbee @ 2024-11-15 11:00:29
"if(a[i]<c)"改为"if(a[i]<=c)"
by cj240816ytq @ 2024-11-19 17:09:51
确实,要把"if(a[i]<c)"改为"if(a[i]<=c)"
嗯嗯嗯~~~对了