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