题目描述
输入一批角的度数,让计算机统计其中有多少个直角。
输入
输入数据为两行。
第一行输入角的个数。
第二行输入n角的度数。
输出
输出直角的个数s的值。
样例输入
6
78 45 60 90 90 12
样例输出
2
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
#define N 1005
int a[N];
int main() {
int n;
int cnt = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int j = 1; j <= n; j++) {
if (a[j] == 90) {
cnt++;
}
}
cout << cnt << endl;
return 0;
}
点赞收藏和关注别忘了!
960

被折叠的 条评论
为什么被折叠?



