fork(1) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int score[5];
  5. int totalScore = 0;
  6. int i;
  7. printf("Input the scores of five students:\n");
  8. for(i=0;i<5;i++)
  9. {
  10. scanf("%d",&score[i]);
  11. totalScore=totalScore+score[i];
  12. }
  13. printf("The average sore is %f\n",totalScore/40.0);
  14. return 0;
  15. }
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
Input the scores of five students:
The average sore is 24670230.100000