BJGBNJH @ 2023-11-10 22:39:15
#include<bits/stdc++.h>
using namespace std;
int a[20];
int n;
int j;
int main(){
cin>>n;
for(int i=1;i<=10;i++){
cin>>a[i];
}
n+=30;
for(int i=1;i<=10;i++){
if(a[i]<=n){
j++;
}
}
cout<<j;
return 0;
}
by silent_ST @ 2023-11-10 22:41:16
其实是先输入a数组再输入n的来着
by ink114514 @ 2023-11-12 21:21:30
代码的网址(仅供参考):↓
https://www.luogu.com.cn/problem/P1046#submit
by yzhleo @ 2023-11-13 21:17:10
正确代码如下:
#include<iostream>
using namespace std;
int main()
{
int a[15],n,sum=0;
for(int i=1;i<=10;i++)
{
cin>>a[i];
}
cin>>n;
for(int i=1;i<=10;i++)
{
if(a[i]<=n+30) sum++;
}
cout<<sum;
return 0;
}
by __youzimo2014__ @ 2024-05-26 09:49:09
@BJGBNJH 先输入