UVA 1225 - Digit Counting UVA • Sep 1, 2020 Problem PDFSolution:#include #include #include #include #include #include #include #include #include #include #include #include #define ll long long #define sc scanf #define pf printf #define Pi 2*acos(0.0) using namespace std; int main() { int t; sc("%d",&t); while(t--) { mapmp; int n; sc("%d",&n); for(int i=1;i<=n;i++) { int tp=i; while(tp>0) { mp[tp%10+'0']++; tp=tp/10; } } pf("%d %d %d %d %d %d %d %d %d %d\n",mp['0'],mp['1'],mp['2'], mp['3'],mp['4'],mp['5'],mp['6'],mp['7'],mp['8'],mp['9']); } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/1225/1225.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read