fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i[11];
  5. int x, a8=0, a14=0, a3=0, j=0, a4=0, z=0, c=0, l=0;
  6. while(1){if(scanf("%d\n",&x)<1)break;
  7. i[j]=x;
  8. if(i[z]==8){a8++;}
  9. if(i[z]==14){a14++;}
  10. if(i[z]==3){a3++;}
  11. if(i[z]==4){a4++;}
  12. if(a8>a14&&a8>a3&&a8>a4){printf("8(%d)",a8);}
  13. else if(a8==a14&&a8>a3&&a8>a4){printf("8 14(%d)",a8);}
  14. else if(a8==a14&&a8==a4&&a8>a3){printf("8 14 4(%d)",a8);}
  15. else if(a8==a14&&a8==a3&&a8>a4){printf("8 14 3(%d)",a8);}
  16. else if(a14>a8&&a14>a3&&a14>a4){printf("14(%d)",a14);}
  17. printf("\n");
  18. z++;
  19. j++;
  20. }
  21. return 0;
  22. }
  23.  
  24.  
Success #stdin #stdout 0s 4408KB
stdin
8
14
4
14
3
8
8
3
14
3
stdout
8(1)
8 14(1)
8 14 4(1)
14(2)
14(2)
8 14(2)
8(3)
8(3)
8 14(3)
8 14 3(3)