Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int number; scanf("%d", &number);
  6.     int x; x = number;
  7.  
  8.     int count; count = 0;
  9.     while (x)
  10.     {
  11.         x = x / 10;
  12.         count += 1;
  13.     }
  14.     int count1; count1 = count - 1;
  15.     int a[count1];
  16.     while(count1 + 1)
  17.     {
  18.         a[count1] = number % 10;
  19.         number = number / 10;
  20.         count1 -= 1;
  21.     }
  22.  
  23.     int count2; count2 = count - 1;
  24.     int check[count2];
  25.  
  26.     int i; i = 0;
  27.     while (i < count)
  28.     {
  29.         check[i] = 0;
  30.         i += 1;
  31.     }
  32.  
  33.     int j; j = 0;
  34.     int j1; j1 = 0;
  35.     while (j < count)
  36.     {
  37.         j1 = 0;
  38.         while (j1 < count)
  39.         {
  40.             if (a[j] = j1) check[j1] += 1;
  41.             j1 += 1;
  42.         }
  43.         j += 1;
  44.     }
  45.      int k; k = 0;
  46.      while (k < count)
  47.      {
  48.          printf("%d: %d\n", k, check[k]);
  49.         k++;
  50.      }
  51.  
  52.  
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement