fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4. int array[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  5. int counter=0, c, position;
  6. while ((c = getchar()) != EOF){
  7. if(c == ' '){
  8. array[counter]++;
  9. counter = 0;
  10. } else {
  11. counter ++;
  12. }
  13. }
  14. if(counter!=0) {
  15. array[counter]++;
  16. }
  17. position = 0;
  18. for (position = 0; position < 10; ++position){
  19. printf("%d", array[position]);
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 3300KB
stdin
o th thr
stdout
0111000000