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. max_score=score[0];
  23. for(j=0;j<3;j++){
  24. max_score=score[0];
  25. for(i=0;i<NUM;i++)
  26. {
  27. if(score[i]>max_score){
  28. max_score=score[i];
  29.  
  30. }
  31.  
  32. }
  33. printf("%d人目 ",i+1);
  34. max_score=0;
  35. }
  36.  
  37. }
  38.  
  39.  
Success #stdin #stdout 0s 5328KB
stdin
25
39
42
76
35
48
81
41
74
90


stdout
1人目の点数:25
2人目の点数:39
3人目の点数:42
4人目の点数:76
5人目の点数:35
6人目の点数:48
7人目の点数:81
8人目の点数:41
9人目の点数:74
10人目の点数:90

合格者: 11人目  11人目  11人目