fork download
  1. #include <stdio.h>
  2. #define student 3
  3.  
  4. int main(void) {
  5. // your code goes here
  6. int i;
  7. double sum=0;
  8. double average;
  9. int score[student];
  10.  
  11. for(i=0;i<student;i++){
  12. scanf("%d",&score[i]);
  13. }
  14.  
  15. for(i=0;i<student;i++){
  16. sum+=score[i];
  17. }
  18.  
  19. average=sum/student;
  20. printf("%f\n",average);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
-139781360.000000