fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. int N;
  5. scanf("%d", &N);
  6. int arr[N];
  7. for (int i = 0; i < N; i++){
  8. scanf("%d", arr[i]);
  9. }
  10. int s;
  11. for (int i = 0; i < N; i += 2){
  12. s += arr[i];
  13. }
  14. float d = s / N;
  15. printf("%f", d);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5264KB
stdin
Standard input is empty
stdout
-263486.000000