dalao1575 @ 2022-10-15 10:30:08
#include <stdio.h>
int main (){
int apples[10];
for(int i=0;i<10;i++){
scanf("%d ",&apples[i]);
}
int loog,num=0;
scanf("%d",&loog);
loog=loog+30;
for(int i=0;i<10;i++){
if(loog>apples[i]){
num=num+1;
}
}
printf("%d",num);
return 0;
}
by dalao1575 @ 2022-10-15 10:32:15
找到惹,if(loog>apples[i])没加=号,各位萌新不要像我一样哦
by Liuyilin1 @ 2022-10-15 14:52:25
#include<bits/stdc++.h>
using namespace std;
int a[10];
int main(){
int n;
for(int i=1;i<=10;i++){
cin>>a[i];
}
cin>>n;
n+=30;
int sum=0;
for(int i=1;i<=10;i++){
if(a[i]<=n){
sum++;
}
}
cout<<sum;
return 0;
}
AC代码。
关注一下
by 1145141919810awa @ 2022-10-21 21:13:54
#include<iostream>
using namespace std;
int main()
{
int apple[11],i,h,ans=0;
for(int i=1;i<=10;i++) cin>>apple[i];
cin>>h;
for(i=1;i<=10;i++)
if(h+30>=apple[i]) ans++;
cout<<ans<<endl;
return 0;
}
by 1145141919810awa @ 2022-10-21 21:14:21
@wxtnb666 难吗?
by King_of_Hell @ 2022-11-17 22:16:55
@Liuyilin1
好吗.....
我表示你不要脸
但我还是关注了