fork(1) download
  1. #include <stdio.h>
  2. #define N 200
  3. int main(void)
  4. {
  5. int i, n, score[N];
  6. printf("How many students?");
  7. scanf("%d", &n);
  8. for (i=0; i<n; i++)
  9. {
  10. scanf("%d", &score[i]);
  11. }
  12. int fail=0;
  13. for (i=0;i<n;i++)
  14. {
  15. if(score[i]<60)
  16.  
  17. printf("%d",score[i]);
  18. fail++;
  19. }
  20. printf("不及格的人数为:%d",fail);
  21. return 0;
  22. }
Success #stdin #stdout 0s 544KB
stdin
12
60 45 41 98 97 96 78 93 91 93 12 34
stdout
How many students?45411234不及格的人数为:12