Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- int number; scanf("%d", &number);
- int x; x = number;
- int count; count = 0;
- while (x)
- {
- x = x / 10;
- count += 1;
- }
- int count1; count1 = count - 1;
- int a[count1];
- while(count1 + 1)
- {
- a[count1] = number % 10;
- number = number / 10;
- count1 -= 1;
- }
- int count2; count2 = count - 1;
- int check[count2];
- int i; i = 0;
- while (i < count)
- {
- check[i] = 0;
- i += 1;
- }
- int j; j = 0;
- int j1; j1 = 0;
- while (j < count)
- {
- j1 = 0;
- while (j1 < count)
- {
- if (a[j] = j1) check[j1] += 1;
- j1 += 1;
- }
- j += 1;
- }
- int k; k = 0;
- while (k < count)
- {
- printf("%d: %d\n", k, check[k]);
- k++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement