#include<stdio.h> main() { int a, b; while (scanf("%d %d", &a, &b)!=EOF) { int arr[10] = { 0 }; for (int i = a; i <= b; i++) { int t = i; while (t != 0) { ++arr[t % 10]; t = t / 10; } } for (int i = 0; i < 10; i++) { if (i != 9) { printf("%d ", arr[i]); } else { printf("%d\n", arr[i]); } } } } |
Double click to view unformatted code.