fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a,n[20],b=101,c=103,worst,second_worst=11,t;
  5. for(a=1;a<11;a++){
  6. scanf("%d",&n[a]);
  7. printf("%d人目の点数:%d\n",a,n[a]);
  8. if(n[a]<b){
  9. t=worst;
  10. worst=a;
  11. second_worst=t;
  12.  
  13. }
  14. else if((n[a]>b)&&(n[a]<c)){
  15. second_worst=a;
  16.  
  17. }
  18. }
  19. printf("9位:%d人目\n",second_worst);
  20. return 0;
  21. }
Success #stdin #stdout 0s 5308KB
stdin
1
3
5
45
67
82
99
23
34
54
stdout
1人目の点数:1
2人目の点数:3
3人目の点数:5
4人目の点数:45
5人目の点数:67
6人目の点数:82
7人目の点数:99
8人目の点数:23
9人目の点数:34
10人目の点数:54
9位:9人目