B.cpp 364 B

12345678910111213141516171819202122
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int st,ed,t,temp;
  6. cin>>st>>ed;
  7. int a[10]={0};
  8. for(int i=st;i<=ed;i++){
  9. t=i;
  10. while(t){
  11. temp=t%10;
  12. a[temp]++;
  13. t/=10;
  14. }
  15. }
  16. for(int i=0;i<=9;i++){
  17. if(i) cout<<" ";
  18. cout<<a[i];
  19. }
  20. cout<<endl;
  21. return 0;
  22. }