fork download
  1. #ifndef FUNCTION06_H_
  2. #define FUNCTION06_H_
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6.  
  7. double average(int scores[], int size);
  8.  
  9. int main() {
  10. int n; scanf("%d", &n);
  11. int *scores = new int[n];
  12. for(int i = 0; i < n; i++) scanf("%d", scores + i);
  13. double ans = average(scores, n);
  14. printf("%.6f\n", ans);
  15. return 0;
  16. }
  17. #endif // FUNCTION06_H_
  18.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#ifndef FUNCTION06_H_
^
Main.java:2: error: illegal character: '#'
#define FUNCTION06_H_
^
Main.java:4: error: illegal character: '#'
#include <stdio.h>
^
Main.java:5: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:9: error: class, interface, or enum expected
int main() {
^
Main.java:10: error: class, interface, or enum expected
  int n; scanf("%d", &n);
         ^
Main.java:11: error: class, interface, or enum expected
  int *scores = new int[n];
  ^
Main.java:12: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) scanf("%d", scores + i);
  ^
Main.java:12: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) scanf("%d", scores + i);
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) scanf("%d", scores + i);
                        ^
Main.java:13: error: class, interface, or enum expected
  double ans = average(scores, n);
  ^
Main.java:14: error: class, interface, or enum expected
  printf("%.6f\n", ans);
  ^
Main.java:15: error: class, interface, or enum expected
  return 0;
  ^
Main.java:16: error: class, interface, or enum expected
}
^
Main.java:17: error: illegal character: '#'
#endif // FUNCTION06_H_
^
15 errors
stdout
Standard output is empty