#include<bits/stdc++.h> using namespace std; int main() { int a, b; int num[10] = { 0 }; while (cin >> a >> b) { if (a > b) { int temp = a; a = b; b = temp; } for (int i = a+1; i < b; i++) { int t = i; while (t) { num[t % 10]++; t /= 10; } } for (int i = 0; i < 10; i++) { if (i!= 9) { cout << num[i] << " "; } else { cout << num[i] << endl; } } } return 0; } |
Double click to view unformatted code.