1 solutions

  • 0
    @ 2023-1-21 19:56:45
    #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;
        }
    }
    
    • 1

    Information

    ID
    518
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    10
    Tags
    # Submissions
    3
    Accepted
    3
    Uploaded By