Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- map<int,ll>mp;
- void fun(string s)
- {
- for(int i=0;i<s.size();i++)
- {
- if(s[i]=='0')
- mp[0]++;
- else if(s[i]=='1')
- mp[1]++;
- else if(s[i]=='2')
- mp[2]++;
- else if(s[i]=='3')
- mp[3]++;
- else if(s[i]=='4')
- mp[4]++;
- else if(s[i]=='5')
- mp[5]++;
- else if(s[i]=='6')
- mp[6]++;
- else if(s[i]=='7')
- mp[7]++;
- else if(s[i]=='8')
- mp[8]++;
- else if(s[i]=='9')
- mp[9]++;
- }
- }
- int main()
- {
- // freopen("input.txt","r",stdin);
- // freopen("output.txt","w",stdout);
- //string a,b;
- ll a,b,i,j,k,c;
- while(cin>>a>>b)
- {
- if(a==0 && b==0)
- break;
- mp.clear();
- for(i=a;i<=b;i++)
- {
- string s=to_string(i);
- // cout<<s<<endl;
- fun(s);
- }
- for(auto i=mp.begin();i!=mp.end();i++)
- cout<<i->second<<" ";
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement