Submission #493250

#TimeUsernameProblemLanguageResultExecution timeMemory
493250123Prosjek (COCI18_prosjek)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; int x[100]; for(int i=0;i<n;i++){ cin>> x[i]; } sort(x,x+n); int r; x[1]=(x[0]+x[1])/2; for(int i=2;i<n;i++){ x[i]=(x[i-1]+x[i])/2 } cout<< x[n-1] << endl; }

Compilation message (stderr)

prosjek.cpp: In function 'int main()':
prosjek.cpp:13:25: error: expected ';' before '}' token
   13 |     x[i]=(x[i-1]+x[i])/2
      |                         ^
      |                         ;
   14 |   }
      |   ~                      
prosjek.cpp:10:7: warning: unused variable 'r' [-Wunused-variable]
   10 |   int r;
      |       ^