Files
python/TangDou/LuoGuBook/P1980_Study.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

20 lines
355 B
C++

#include <bits/stdc++.h>
using namespace std;
int x;
const int N = 10;
int b[N];
// int -> INT_MAX-> 2^31-1
// 2147483647
// 1124324234 不溢出
// 0232300000
int main() {
cin >> x;
while (x) {
int a = x % 10;
b[a]++;
x /= 10;
}
for (int i = 0; i <= 9; i++) cout << b[i] << " ";
return 0;
}