fork download
  1. #include <iostream>
  2. using namespace std;
  3. int x[10];
  4. int main() {
  5. char c;
  6. while((c=cin.get())!=EOF){
  7. x[c-'0']++;
  8. }
  9. for(int i=0;i<10;i++){
  10. cout<<x[i]<<" ";
  11. }
  12.  
  13. // your code goes here
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5316KB
stdin
45634552346
stdout
0 0 1 2 3 3 2 0 0 0