fork download
  1. #include <stdio.h>
  2. #define NUM 10
  3.  
  4. int main()
  5. {
  6. int i,j,a;
  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. a=10;
  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. a=a-1;
  31. }else{
  32. a=a+1;
  33. }
  34.  
  35. }
  36.  
  37. printf("%d",a);
  38.  
  39.  
  40. }
  41.  
Success #stdin #stdout 0s 5284KB
stdin
43
56
64
89
57
60
75
58
35
99
stdout
1人目の点数:43
2人目の点数:56
3人目の点数:64
4人目の点数:89
5人目の点数:57
6人目の点数:60
7人目の点数:75
8人目の点数:58
9人目の点数:35
10人目の点数:99

合格者: 12