Advertisement
zsoltizbekk

Untitled

Mar 10th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.11 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int t = 0;
  6. scanf ("%d" , &t );
  7.  while ( t--> 0 )
  8.  {
  9.  int a,b,c,d,x;
  10.  int e = 0;
  11.  int f = 0;
  12.  int g = 0;
  13.  int h = 0;
  14.  int j = 0;
  15.  int k = 0;
  16.  int l = 0;
  17.  int m = 0;
  18.  int n = 0;
  19.  int i = 0;
  20.  scanf ( "%d\n" , &x );
  21.   if ( n < 10 )
  22.    {
  23.    a = x;
  24.    }
  25.   else if ( x < 100 )
  26.    {
  27.    a = (( x % 100 ) - ( x % 10 ))/10;
  28.    b = x % 10;
  29.    }
  30.   else if ( x < 1000 )
  31.    {
  32.    a = (( x % 1000 )-( x % 100 )-( x % 10 ))/100;
  33.    b = (( x % 100 ) - ( x % 10 ))/10;
  34.    c = x % 10;
  35.    }
  36.   else if( x < 10000 )
  37.    {
  38.    a = (( x % 10000 ) - ( x% 1000 ) - ( x % 100 ) - ( x % 10 ))/1000;
  39.    b = (( x % 1000 ) - ( x % 100 ) - ( x % 10 ))/100;
  40.    c = (( x % 100 ) - ( x % 10 ))/10;
  41.    d = x % 10;
  42.    }
  43.   if ( a == 1 )
  44.    e=e+1;
  45.   else if ( a == 2 )
  46.    f=f+1;
  47.   else if ( a == 3 )
  48.    g=g+1;
  49.   else if ( a == 4 )
  50.    h=h+1;
  51.   else if ( a == 5 )
  52.    j=j+1;
  53.   else if ( a == 6 )
  54.    i=i+1;
  55.   else if ( a == 7 )
  56.    k=k+1;
  57.   else if ( a == 8 )
  58.    l=l+1;
  59.   else if ( a == 9 )
  60.    m=m+1;
  61.   else if ( a == 0 )
  62.    n=n+1;
  63.   if ( b == 1 )
  64.    e=e+1;
  65.   else if ( b == 2 )
  66.    f=f+1;
  67.   else if ( b == 3 )
  68.    g=g+1;
  69.   else if ( b == 4 )
  70.    h=h+1;
  71.   else if ( b == 5 )
  72.    j=j+1;
  73.   else if ( b == 6 )
  74.    i=i+1;
  75.   else if ( b == 7 )
  76.    k=k+1;
  77.   else if ( b == 8 )
  78.    l=l+1;
  79.   else if ( b == 9 )
  80.    m=m+1;
  81.   else if ( b == 0 )
  82.    n=n+1;
  83.   if ( c == 1 )
  84.    e=e+1;
  85.   else if ( c == 2 )
  86.    f=f+1;
  87.   else if ( c == 3 )
  88.    g=g+1;
  89.   else if ( c == 4 )
  90.    h=h+1;
  91.   else if ( c == 5 )
  92.    j=j+1;
  93.   else if ( c == 6 )
  94.    i=i+1;
  95.   else if ( c == 7 )
  96.    k=k+1;
  97.   else if ( c == 8 )
  98.    l=l+1;
  99.   else if ( c == 9 )
  100.    m=m+1;
  101.   else if ( c == 0 )
  102.    n=n+1;
  103.   if ( d == 1 )
  104.    e=e+1;
  105.   else if ( d == 2 )
  106.    f=f+1;
  107.   else if ( d == 3 )
  108.    g=g+1;
  109.   else if ( d == 4 )
  110.    h=h+1;
  111.   else if ( d == 5 )
  112.    j=j+1;
  113.   else if ( d == 6 )
  114.    i=i+1;
  115.   else if ( d == 7 )
  116.    k=k+1;
  117.   else if ( d == 8 )
  118.    l=l+1;
  119.   else if ( d == 9 )
  120.    m=m+1;
  121.   else if ( d == 0 )
  122.    n=n+1;
  123.  printf( "%d %d %d %d %d %d% d% d% d% d%" , e , f , g , h , j , i , k , l , m , n );
  124.  }
  125. return 0;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement