fork download
  1. #include <stdio.h>
  2. #define NUM 10
  3. int main(void) {
  4. int data[10], count, i, j, first, second;
  5.  
  6. for(i=0;i<NUM;i++){
  7. first = data[i];
  8. count = 0;
  9. for(j=0;j<NUM;j++){
  10. if(first < data[j]) count++;
  11. }
  12. if(count==1) break;
  13. }
  14.  
  15. for(i=0;i<NUM;i++){
  16. second = data[i];
  17. count = 0;
  18. for(j=0;j<NUM;j++){
  19. if(second < data[j]) count++;
  20. }
  21. if(count==1) break;
  22. }
  23.  
  24. printf("1人目は%d点\n", first);
  25. printf("2人目は%d点\n",second);
  26.  
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 5288KB
stdin
1 2 3 4 5 6 7 8 9 0
stdout
1人目は1253941792点
2人目は1253941792点