fork download
  1. #include <stdio.h>
  2. #define NUM 11
  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.  
  14. }
  15.  
  16. a=0;
  17. max_score=score[0];
  18.  
  19. for(j=0;j<5;j++){
  20. for(i=0;i<NUM;i++)
  21. {
  22.  
  23. if(score[i]>max_score){
  24. max_score=score[i];
  25. a=i;
  26. }
  27.  
  28. }
  29.  
  30.  
  31. score[a]=0;
  32. a=0;
  33. max_score=score[0];
  34. }
  35. for(i=0;i<NUM;i++)
  36. {
  37.  
  38. if(score[i]>max_score){
  39. max_score=score[i];
  40. a=i;
  41. }
  42. }
  43. printf("tyuoti=%d",score[a]);
  44. }
Success #stdin #stdout 0.01s 5316KB
stdin
1
2
3
4
5
6
7
8
9
10
11
stdout
tyuoti=6