fork download
  1. #include <stdio.h>
  2. #define NUM 10
  3. int main(void){
  4. int i,j,date[NUM],pass,count;
  5. printf("合格者:");
  6. for(i=0;i<=NUM;i++)
  7. {
  8. scanf("%d",&date[i]);
  9. pass=date[i];
  10. count=0;
  11. for(j=0;j<NUM;j++)
  12. {
  13. if(pass<date[j]) count++;
  14. }
  15. if(count<=2)
  16. {
  17. printf("\n%d人目 %d",i,pass);
  18. }
  19. }
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0.01s 5320KB
stdin
11,23,46,74,85,97,87,45,29,66
stdout
合格者:
2人目 993012565
6人目 1891861109
8人目 994388768