fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, a, suma;
  6. cin>>n;
  7. for (int i=0; i<n; i++)
  8. {
  9. cin>>a;
  10. suma=0;
  11. for (int j=0; j<=9; j++)
  12. {
  13. if (a%10==j)
  14. {
  15. suma++;
  16. }
  17. cout<<suma<<"\n";
  18. }
  19. }
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 4192KB
stdin
3
1 2 3

stdout
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
1