fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4.  
  5. int numbers[10],i,j,count;
  6.  
  7. for(i=0;i<10;i++){
  8. scanf("%d", &numbers[i]);
  9. }
  10.  
  11. printf("合格者:\n");
  12. for(i=0;i<10;i++){
  13. count=0;
  14. for(j=0;j<10;j++){
  15. if(numbers[i]<numbers[j]){
  16. count++;
  17. }}
  18. if(count<=2){
  19. printf("%d人目 %d点\n",i+1,numbers[i]);
  20. }}
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5320KB
stdin
95 79 92 41 53 89 99 34 91 64
stdout
合格者:
1人目 95点
3人目 92点
7人目 99点