likepuppy @ 2023-08-02 16:15:21
如题
#include<bits/stdc++.h>
long long a[11];
int main()
{
long long n,sum;
cin>>n;
n=n+30;
for(register long long i=0;i<10;i++)
{
cin>>a[i];
}
for(register long long j=0;j<10;j++)
{
if(n>=a[j])
sum++;
}
cout<<sum<<endl;
return 0;
}
by SimpleJony @ 2023-08-02 16:30:39
@likepuppy 没有命名空间 第二行加上
using namespace std;
by juruo_zxt @ 2023-08-02 16:31:57
@likepuppy 您的错误在于没有写"使用标准命名空间"
by likepuppy @ 2023-08-02 16:33:19
@PHzxt o(╥﹏╥)o谢谢
by likepuppy @ 2023-08-02 16:34:41
@SimpleJony (^-^)V谢谢,脑子抽筋没看出来orz
by wmbwww @ 2023-08-05 14:16:33
#include <bits/stdc++.h>
using namespace std;
int h[20],H,s;
int main(){
for(int i=0;i<10;i++){
cin >> h[i];
}cin >> H;
H += 30;
for(int i=0;i<10;i++){
s+=!(H<h[i]);
}cout << s;
return 0;
}
by Aurora09 @ 2023-08-18 19:41:05
using namespace std;
long long a[11];
int main()
{
long long n,sum=0;
for(register long long i=0;i<10;i++)
{
cin>>a[i];
}
cin>>n;
n=n+30;
for(register long long j=0;j<10;j++)
{
if(n>=a[j])
sum++;
}
cout<<sum<<endl;
return 0;
}
by Ace2012 @ 2023-08-28 11:57:29
陶某人的高度最后输入,改一下位置
by yuzhang_chen @ 2023-12-10 23:06:42
sum没定义初始值