Submission #242036

#TimeUsernameProblemLanguageResultExecution timeMemory
242036TechstuffProsjek (COCI18_prosjek)C++17
Compilation error
0 ms0 KiB
#include<iostream> #include<algorithm> using namespace std; int main() { int n; cin>>n; double arr[n]; for(int i=0; i<n; i++) cin>>arr[i]; sort(arr, arr+n); double avg = arr[0]; for(int i=1; i<n; i++) avg = (arr[i]+avg)/2 cout<<avg<<endl; }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:20:5: error: expected ';' before 'cout'
     cout<<avg<<endl;
     ^~~~