fork download
  1. #include <stdio.h>
  2. #define NUM 10
  3.  
  4. int main()
  5. {
  6. int i,j;
  7. int score[NUM];
  8. int max_score;
  9.  
  10. for ( i=0 ; i < NUM ; i++ )
  11. {
  12. scanf("%d",&score[i]);
  13. if(score[i]>=0 && score[i]<=100){
  14. printf("%d人目の点数:%d\n",i+1,score[i]);
  15. }else{
  16. printf("%d人目の点数:正しい点数を入力してください\n",i+1);
  17. }
  18. }
  19.  
  20. printf("\n合格者: ");
  21.  
  22.  
  23. max_score=score[0];
  24.  
  25. for(i=0;i<NUM;i++)
  26. {
  27.  
  28. if(score[i]>max_score){
  29. max_score=score[i];
  30. }
  31.  
  32. }
  33.  
  34. printf("%d",score[i]);
  35.  
  36.  
  37. }
  38.  
Success #stdin #stdout 0.01s 5320KB
stdin
51
69
58
31
62
75
60
82
55
43
stdout
1人目の点数:51
2人目の点数:69
3人目の点数:58
4人目の点数:31
5人目の点数:62
6人目の点数:75
7人目の点数:60
8人目の点数:82
9人目の点数:55
10人目の点数:43

合格者: -424639488