Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int t = 0;
- scanf ("%d" , &t );
- while ( t--> 0 )
- {
- int a,b,c,d,x;
- int e = 0;
- int f = 0;
- int g = 0;
- int h = 0;
- int j = 0;
- int k = 0;
- int l = 0;
- int m = 0;
- int n = 0;
- int i = 0;
- scanf ( "%d\n" , &x );
- if ( n < 10 )
- {
- a = x;
- }
- else if ( x < 100 )
- {
- a = (( x % 100 ) - ( x % 10 ))/10;
- b = x % 10;
- }
- else if ( x < 1000 )
- {
- a = (( x % 1000 )-( x % 100 )-( x % 10 ))/100;
- b = (( x % 100 ) - ( x % 10 ))/10;
- c = x % 10;
- }
- else if( x < 10000 )
- {
- a = (( x % 10000 ) - ( x% 1000 ) - ( x % 100 ) - ( x % 10 ))/1000;
- b = (( x % 1000 ) - ( x % 100 ) - ( x % 10 ))/100;
- c = (( x % 100 ) - ( x % 10 ))/10;
- d = x % 10;
- }
- if ( a == 1 )
- e=e+1;
- else if ( a == 2 )
- f=f+1;
- else if ( a == 3 )
- g=g+1;
- else if ( a == 4 )
- h=h+1;
- else if ( a == 5 )
- j=j+1;
- else if ( a == 6 )
- i=i+1;
- else if ( a == 7 )
- k=k+1;
- else if ( a == 8 )
- l=l+1;
- else if ( a == 9 )
- m=m+1;
- else if ( a == 0 )
- n=n+1;
- if ( b == 1 )
- e=e+1;
- else if ( b == 2 )
- f=f+1;
- else if ( b == 3 )
- g=g+1;
- else if ( b == 4 )
- h=h+1;
- else if ( b == 5 )
- j=j+1;
- else if ( b == 6 )
- i=i+1;
- else if ( b == 7 )
- k=k+1;
- else if ( b == 8 )
- l=l+1;
- else if ( b == 9 )
- m=m+1;
- else if ( b == 0 )
- n=n+1;
- if ( c == 1 )
- e=e+1;
- else if ( c == 2 )
- f=f+1;
- else if ( c == 3 )
- g=g+1;
- else if ( c == 4 )
- h=h+1;
- else if ( c == 5 )
- j=j+1;
- else if ( c == 6 )
- i=i+1;
- else if ( c == 7 )
- k=k+1;
- else if ( c == 8 )
- l=l+1;
- else if ( c == 9 )
- m=m+1;
- else if ( c == 0 )
- n=n+1;
- if ( d == 1 )
- e=e+1;
- else if ( d == 2 )
- f=f+1;
- else if ( d == 3 )
- g=g+1;
- else if ( d == 4 )
- h=h+1;
- else if ( d == 5 )
- j=j+1;
- else if ( d == 6 )
- i=i+1;
- else if ( d == 7 )
- k=k+1;
- else if ( d == 8 )
- l=l+1;
- else if ( d == 9 )
- m=m+1;
- else if ( d == 0 )
- n=n+1;
- printf( "%d %d %d %d %d %d% d% d% d% d%" , e , f , g , h , j , i , k , l , m , n );
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement