12345678910111213141516171819202122 |
- #include<bits/stdc++.h>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int a[10] = {
- 0
- };
- for (int p = 1; p <= n; ++p) {
- int q = p;
- while (q) {
- ++a[q % 10];
- q /= 10;
- }
- }
- for (int i = 0; i < 10; ++i) {
- cout << a[i] << endl;
- }
- return 0;
- }
|