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