diff --git a/problem/P1239/P1239.cpp b/problem/P1239/P1239.cpp new file mode 100644 index 00000000..81edd913 --- /dev/null +++ b/problem/P1239/P1239.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; + +int n, ans[15], t; + +int main() { + cin >> n; + for (int i = 1; i <= n; i++) { + t = i; + while (t) { + ans[t % 10]++; + t /= 10; + } + } + for (int i = 0; i < 10; i++) { + cout << ans[i] << endl; + } + return 0; +}