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?\n");
  7. scanf("%d", &n);
  8. fail = 0;
  9. for (i=0; i<n; i++)
  10. {
  11. scanf("%d", &score[i]);
  12. if(score[i]<60){
  13. fail++;
  14. }
  15. }
  16. printf("不及格的人数有%d人\n",fail);
  17. return 0;
  18. }
Success #stdin #stdout 0s 588KB
stdin
12 13 18 78 79 76 75 72 65 56 46
stdout
How many students?
不及格的人数有6人