F1.cpp 346 B

12345678910111213141516171819202122
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int n;
  5. cin >> n;
  6. int a[10] = {
  7. 0
  8. };
  9. for (int p = 1; p <= n; ++p) {
  10. int q = p;
  11. while (q) {
  12. ++a[q % 10];
  13. q /= 10;
  14. }
  15. }
  16. for (int i = 0; i < 10; ++i) {
  17. cout << a[i] << endl;
  18. }
  19. return 0;
  20. }