HDU 6066 RXD's date(水~)

xiaoxiao2021-02-28  96

Description 给出n个数,问不大于35的数有多少个 Input 第一行一整数n,之后n个整数a[i] (1<=t<=1000,0<=a[i]<=50) Output 输出n个整数中不大于35的数的个数 Sample Input 5 33 34 35 36 37 Sample Output 3 Solution 水题 Code

#include<cstdio> using namespace std; const int maxn=1001; int main() { int n,a,ans=0; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a); if(a<=35)ans++; } printf("%d\n",ans); return 0; }
转载请注明原文地址: https://www.6miu.com/read-60898.html

最新回复(0)