Submission #242036

# Submission time Handle Problem Language Result Execution time Memory
242036 2020-06-26T15:49:48 Z Techstuff Prosjek (COCI18_prosjek) C++17
Compilation error
0 ms 0 KB
#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

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