#include <bits/stdc++.h> using namespace std; int n,a[10001],c; int main() { cin >> n; for(int i=1;i<=n;i++) { c=i; while(c>0) { a[c%10]++; c/=10; } } for(int i=0;i<=9;i++) { cout << a[i] << endl; } }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account