Submission #493251

#TimeUsernameProblemLanguageResultExecution timeMemory
493251123Prosjek (COCI18_prosjek)C++14
0 / 50
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; double x[100]; for(int i=0;i<n;i++){ cin>> x[i]; } sort(x,x+n); x[1]=(x[0]+x[1])/2; for(int i=2;i<n;i++){ x[i]=(x[i-1]+x[i])/2; } printf("%.6lf\n",x[n-1]); }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:6:16: warning: 'n' is used uninitialized in this function [-Wuninitialized]
    6 |   for(int i=0;i<n;i++){
      |               ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...