fork(2) 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. scanf("%d", &score[i]);
  9. int fail=0;
  10. for (i=0;i<n;i++)
  11. {
  12. if(score[i]<60)
  13.  
  14. printf("%d",score[i]);
  15. fail++;
  16. }
  17. printf("不及格的人数为:%d",fail);
  18. return 0;
  19. }
Success #stdin #stdout 0s 544KB
stdin
12 60 45 41 98 97 96 78 93 91 93 12 34
stdout
How many students?000000不及格的人数为:12