fork(1) download
  1. #include<stdio.h>
  2. #define SIZE 6
  3. int main(void)
  4. {
  5. int score[SIZE];
  6. int totalScore = 0;
  7. int i;
  8. int n=0;
  9. printf("please input the scores of %d students:\n",SIZE);
  10. for (i = 0; i < SIZE; i++) {
  11. scanf("%d", &score[i]);
  12. totalScore = totalScore + score[i];
  13. }
  14. printf("The average score is %f\n", totalScore / SIZE*1.0);
  15. for(i=0;i < SIZE;i++)
  16. {
  17. printf("%d ",score[i]);
  18. }
  19. for(i=0;i < SIZE;i++)
  20. {
  21. if (score[i]<60)
  22. {n++;}
  23. else {continue;}
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
please input the scores of 6 students:
The average score is -31382496.000000
0 0 -1505516923 22079 1317194528 5336