995! 995!

lyh198 波风水门 2024-09-07 14:05:11 2024-09-07 14:05:18 5

#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; }

{{ vote && vote.total.up }}

共 3 条回复

root 站长

1~m-1,只运行了m-1次,少运行了1次

lyh198 波风水门

???

Wind_Rises 砂糖老师
for (int i = 1; i < m; i++)   // 少读入了一个数