C语言实现统计学生特定分数人数
#include <stdio.h>
int main() { int n, score, count; while (scanf("%d", &n) == 1 && n != 0) { count = 0; int grades[n]; for (int i = 0; i < n; i++) { scanf("%d", &grades[i]); } scanf("%d", &score); for (int i = 0; i < n; i++) { if (grades[i] == score) { count++; } } printf("%d\n", count); } return 0; }
原文地址: https://www.cveoy.top/t/topic/nzhW 著作权归作者所有。请勿转载和采集!