fork download
  1. #include <stdio.h>
  2. int main(){
  3.  
  4. int i,lucky,count,date[10];
  5. for(i=0;i<10;i++)
  6. {
  7. scanf("%d",&date[i]);
  8. printf("%d人目の点数:%d点\n",i+1,date[i]);
  9. }
  10. for(lucky=0;lucky<10;lucky++)
  11. {
  12. count=0;
  13. for(i=0;i<10;i++)
  14. {
  15. if(date[i]<date[lucky])
  16. {
  17. count++;
  18. }
  19. }
  20. if(count==1)
  21. {
  22. printf("9位:%d人目\n",lucky+1);
  23. }
  24. }
  25. }
Success #stdin #stdout 0s 5308KB
stdin
1
2
3
4
5
6
7
8
9
10
stdout
1人目の点数:1点
2人目の点数:2点
3人目の点数:3点
4人目の点数:4点
5人目の点数:5点
6人目の点数:6点
7人目の点数:7点
8人目の点数:8点
9人目の点数:9点
10人目の点数:10点
9位:2人目