1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include <iostream> using namespace std; int N[10000000]; int A = 0, B = 0, C = 0; int n; int k = 0, a = 0, b = 0, c = 0, d=0, e=0, f=0, g=0, h=0, i=0,j=0; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); while (1) { cin >> A >> B >> C; if (100 <= A && A < 1000 && 100 <= B && B < 1000 && 100 <= C && C < 1000) break; } n = A * B * C; while (1) { N[k] = n % 10; if (N[k] == 0) a++; else if (N[k] == 1) b++; else if (N[k] == 2) c++; else if (N[k] == 3) d++; else if (N[k] == 4) e++; else if (N[k] == 5) f++; else if (N[k] == 6) g++; else if (N[k] == 7) h++; else if (N[k] == 8) i++; else if (N[k] == 9) j++; n = n / 10; if (n == 0) break; k++; } cout << a << ‘\n’ << b << ‘\n’ << c << ‘\n’ << d << ‘\n’ << e << ‘\n’ << f << ‘\n’ << g << ‘\n’ << h << ‘\n’ << i << ‘\n’ << j << ‘\n’; return 0; } | cs |