#include <bits/stdc++.h> using namespace std; int main() { int m, n; int a = 0, b = 0, c = 0; cin >> m; for (int i = 1; i < m; i++) { cin >> n; if (n == 1) { a += 1; } if (n == 5) { b += 1; } if (n == 10) { c += 1; } } cout << a << endl; cout << b << endl; cout << c << endl; return 0; }
共 3 条回复
1~m-1,只运行了m-1次,少运行了1次
???