criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<stdio.h>
#include<algorithm>
using namingspace std;
int main()
{
  int N;
  double S[100010];
  scanf("%d",&N);
  for(int i=0;i<N;i++){
    scanf("%lf",&S[i])
  }
  sort(S,S+N);
  double s[100010];
  for(int i=0;i<N-1;i++){
    S[i+1]=(double)(S[i]+S[i+1])/2
      if(i==N-1){
        printf("%lf",S[i+1]);
        return 0;
      }
  }
  
  
{

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namingspace'
    3 | using namingspace std;
      |       ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:23: error: expected ';' before '}' token
   10 |     scanf("%lf",&S[i])
      |                       ^
      |                       ;
   11 |   }
      |   ~                    
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   12 |   sort(S,S+N);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:15:35: error: expected ';' before 'if'
   15 |     S[i+1]=(double)(S[i]+S[i+1])/2
      |                                   ^
      |                                   ;
   16 |       if(i==N-1){
      |       ~~                           
a.cc:23:2: error: expected '}' at end of input
   23 | {
      | ~^
a.cc:23:2: error: expected '}' at end of input
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int>v(n);
	rep(i, n) {
		cin >> v[i];
	}
	sort(v.begin(), v.end());
	double ans = v[0];
	for (int i = 1;i < n;++i) {
		ans = (ans + v[i]) / 2;
	}
	print("%,10\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'print' was not declared in this scope; did you mean 'rint'?
   18 |         print("%,10\n", ans);
      |         ^~~~~
      |         rint
Language: C++

#include "bits/stdc++.h"

#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define FORV(a, A) for (auto &a : A)

using ll = long long;

using namespace std;

void Main()
{
   int N;
   cin >> N;
   set<int> V;
   int v;
   REP(i,0,N-1)
   {
      cin >> v;
      V.insert(v);
   }
   double ans = 0;
   int i=1;
   for(auto v=V.begin();v!=V.end();v++)
   {
      if(i)
      {
         ans += *v;
         i = 0;
         continue;
      }
      ans += *v;
      ans/=2.0;
   }
   cout << ans << endl;
   return;
}

int main()
{
   std::cin.tie(nullptr);
   std::ios_base::sync_with_stdio(false);
   std::cout << std::fixed << std::setprecision(15);
   Main();
   return 0;
}
}

Compiler output:
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
  int i;
  double ans = 0, n;
  cin >> n;
  double ara[n];
  for(i = 0; i < n; i++) {
    cin >> ara[i];
  }
  sort(ara,ara+n);
  ans = (ara[0]+ara[1])/2;
  if(n > 2) {
  for(i = 3; i < n-1; i++) {
    	ans = (ans+ara[i])/2;
  	}
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   10 |   double ara[n];
      |              ^
a.cc:10:14: error: could not convert 'n' from 'double' to 'long unsigned int'
   10 |   double ara[n];
      |              ^
      |              |
      |              double
a.cc:10:14: error: size of array 'ara' has non-integral type 'double'
a.cc:14:15: error: invalid operands of types 'double [1]' and 'double' to binary 'operator+'
   14 |   sort(ara,ara+n);
      |            ~~~^~
      |            |   |
      |            |   double
      |            double [1]
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i= 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) {
     cin >> v[i];
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for ( i = 1; i <n;i++) ans = (ans + v[i])/2;
  printf("%.10f\n",ans);
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'i' was not declared in this scope
   15 |   for ( i = 1; i <n;i++) ans = (ans + v[i])/2;
      |         ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i= ; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) {
     cin >> v[i];
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for ( i = 1; i <n;i++) ans = (ans + v[i])/2;
  printf("%.10f\n",ans);
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:2:30: error: expected primary-expression before ';' token
    2 | #define rep(i,n) for (int i= ; i < (n); ++i)
      |                              ^
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,n) {
      |   ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 |   for ( i = 1; i <n;i++) ans = (ans + v[i])/2;
      |         ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i= ; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) {
     cin >> v[i];
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for ( i = 1; i <n;i++) ans = (ans + v[i))/2;
  printf("%.10f\n",ans);
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:2:30: error: expected primary-expression before ';' token
    2 | #define rep(i,n) for (int i= ; i < (n); ++i)
      |                              ^
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,n) {
      |   ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 |   for ( i = 1; i <n;i++) ans = (ans + v[i))/2;
      |         ^
a.cc:15:42: error: expected ']' before ')' token
   15 |   for ( i = 1; i <n;i++) ans = (ans + v[i))/2;
      |                                          ^
      |                                          ]
Language: C++

include<bits/stdc++.h>
#define rep(i,n) for (int i= ; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) {
     cin >> v[i];
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for ( i = 1; i <n;i++) ans = (ans + v[i))/2;
  printf("%.10f\n",ans);
  return 0;
  }

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n;
      |   ^~~
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> v(n);
      |   ^~~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> v(n);
      |          ^~~
a.cc:2:30: error: expected primary-expression before ';' token
    2 | #define rep(i,n) for (int i= ; i < (n); ++i)
      |                              ^
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,n) {
      |   ^~~
a.cc:11:13: error: 'v' was not declared in this scope
   11 |      cin >> v[i];
      |             ^
a.cc:13:8: error: 'v' was not declared in this scope
   13 |   sort(v.begin(), v.end());
      |        ^
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
a.cc:15:9: error: 'i' was not declared in this scope
   15 |   for ( i = 1; i <n;i++) ans = (ans + v[i))/2;
      |         ^
a.cc:15:42: error: expected ']' before ')' token
   15 |   for ( i = 1; i <n;i++) ans = (ans + v[i))/2;
      |                                          ^
      |                                          ]
a.cc:16:3: error: 'printf' was not declared in this scope
   16 |   printf("%.10f\n",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<bits/stdc++.h>
Language: C++

int main() {
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    sort(v.begin(), v.end());
    double ans = v[0];
    for (int i = 1; i < n; i++) ans += (double) (ans+v[i])/2;
    cout << setprecision(12) << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:12: error: 'cin' was not declared in this scope
    2 |     int n; cin >> n;
      |            ^~~
a.cc:3:5: error: 'vector' was not declared in this scope
    3 |     vector<int> v(n);
      |     ^~~~~~
a.cc:3:12: error: expected primary-expression before 'int'
    3 |     vector<int> v(n);
      |            ^~~
a.cc:4:9: error: 'i' was not declared in this scope
    4 |     rep(i,n) cin >> v[i];
      |         ^
a.cc:4:5: error: 'rep' was not declared in this scope
    4 |     rep(i,n) cin >> v[i];
      |     ^~~
a.cc:5:10: error: 'v' was not declared in this scope
    5 |     sort(v.begin(), v.end());
      |          ^
a.cc:5:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    5 |     sort(v.begin(), v.end());
      |     ^~~~
      |     short
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << setprecision(12) << ans << endl;
      |     ^~~~
a.cc:8:13: error: 'setprecision' was not declared in this scope
    8 |     cout << setprecision(12) << ans << endl;
      |             ^~~~~~~~~~~~
a.cc:8:40: error: 'endl' was not declared in this scope
    8 |     cout << setprecision(12) << ans << endl;
      |                                        ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

int main() {
	
   int n;
   cin >> n;
   vector<long double> v(n);

   for(int i=0;i<n;i++){
      cin >> v[i]; 
   }
   
   sort(v.begin(), v.end())
   
   long double ans = v[0];
   for(int i=1;i<n;i++){
    ans = (ans +v[i]) / 2; 
   } 

  cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: expected ';' before 'long'
   21 |    sort(v.begin(), v.end())
      |                            ^
      |                            ;
   22 | 
   23 |    long double ans = v[0];
      |    ~~~~                     
a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     ans = (ans +v[i]) / 2;
      |     ^~~
      |     abs
a.cc:28:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
using namespace std;

int a[50];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  
  double ans = a[0];
  for (int i = 1; i < n; ++i) {
    ans = (ans + a[i]) / 2;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(a, a + n);
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int>v(N);
    for(int i = 0; i < N; i++){
        cin >> v[i];
    }
    sort(v.begin(), v.end());
    double ans = v[0];
    for(int i = 1; i < N; i++){
        ans += v[i];
        ans /= 2;
    }
    cout << ans << endl;
    return 0;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(v.begin(), v.end());
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  vector <double> vec(N);
  cin >> N;
  for (int i=0;i<N;i++){
    cin >> vec[i] ;
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  vector <double> two(N);
  two[0]=2;
  two[N-1]=two[NN-1];
  for (int i=1;i<N-1;i++){
    two[i]=2*two[i-1];
  }
  double sum=0;
  for (int i=0; i<N;i++){
    sum+=vec[i]/two[i];
  }
  cout  << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'NN' was not declared in this scope; did you mean 'N'?
   15 |   two[N-1]=two[NN-1];
      |                ^~
      |                N
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  vector <double> vec(N);
  cin >> N;
  for (int i=0;i<N;i++){
    cin >> vec[i] ;
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  vector <double> two(N);
  two[0]=2;
  two[N-1]=two[NN-1]
  for (int i=1;i<N-1;i++){
    two[i]=2*two[i-1];
  }
  double sum=0;
  for (int i=0; i<N;i++){
    sum+=vec[i]/two[i];
  }
  cout  << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'NN' was not declared in this scope; did you mean 'N'?
   15 |   two[N-1]=two[NN-1]
      |                ^~
      |                N
a.cc:16:16: error: 'i' was not declared in this scope
   16 |   for (int i=1;i<N-1;i++){
      |                ^
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using ll = long long;
using namespace std;

int main() {
    int n = 0;
    cin >> n;
    vector<double> v(n);
    for (int i=0; i<n; i++) {
        cin >> v.at(i);
    }
    sort(v.begin(), v.end());
    double ans = a.at(0);
    for (int i=1; i<n; i++) {
        ans = (ans + v.at(i)) / 2;
    }
    cout << fixed;
    cout << setprecision(10) << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: 'a' was not declared in this scope
   24 |     double ans = a.at(0);
      |                  ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  double ans = a[0];
  for(int i = 1; i < n; i++) ans = (ans + a[i]) / 2;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	int n; cin >> n;
  	vector <int> a(n);
  for(int i = 0; i < n; i+=1) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  double res = a[0];
  for(int i = 1; i < a.size(); i+= 1) {
  	res = (a[i] + prev)/2;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '<unresolved overloaded function type>' to binary 'operator+'
   14 |         res = (a[i] + prev)/2;
Language: C++

#include <bits/stdc++.h>
using namespace std;

void swap (double v[], int i, int j){
	double tmp = v[i];
  	v[i] = v[j];
  	v[j] = tmp;
}

void sort (double v[], int n){
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n-1; j++)
      if (v[j+1] < v[j])
        swap (v, j, j+1);
}

int main(){
  
  int N,count = 0;
  cin >> N;
  double v[N],blend,sum;
  for (int i = 0; i < N; i++)
    cin >> v[i];
  
  sort (v, N);
  
  for(int i = 1; i < N; i++){
    if(v[i]%v[0] == 0)
      count++;
  }
  
  if (count = N-1)
    blend = v[0];
   else if (N == 2)
   blend = (v[0]+v[1])/2;
  
  else if (N >= 3){
	for(int i = 1; i < N; i++){
      if (i == 1){
        blend = (v[0]+v[1])/2;
        sum = blend;
        blend = 0;
      }
      else {
        blend += (sum + v[i])/2;
        sum = blend;
      }
    }    
  }
  cout << blend << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   28 |     if(v[i]%v[0] == 0)
      |        ~~~~^~~~~
      |           |    |
      |           |    double
      |           double
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main()
{
	int n,i,x,j;
	long long double v[100],o,temp;
	
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>v[i];
	}
	
	//sort(v);
	for(i=0;i<n;i++)
		for(j=i;j<n;j++)
		{
			if(v[i]>v[j])
			{
				temp=v[i];
				v[i]=v[j];
				v[j]=temp;
			}
		}
	
	x=1;
	o=v[0]+v[1];
	for(i=2;i<n;i++)
	{
		x*=2;
		o+=v[i]*x;
	}
	x*=2;
	
	o/=x;
	
	cout<<o;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'long long' specified with 'double'
    8 |         long long double v[100],o,temp;
      |              ^~~~
a.cc:8:14: error: 'long long' specified with 'double'
a.cc:8:14: error: 'long long' specified with 'double'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

double max(double a, double b);
double maxpath(int s,int N);

double v[52],value[52],d[52][52],cost[52],nmax;

int main(void){
  int N,i,j;
  char str[1000],*p;
  
  fgets(str,sizeof(str),stdin);
  N=atoi(str);
  fgets(str,sizeof(str),stdin);
  p=strtok(str," \n");
  v[0]=atof(p);
  
  for(i=1;i<N;i++){
    p=strtok(NULL," \n");
    v[i]=atof(p);
  }
  
  for(i=0;i<N;i++){
    for(j=0;j<i;j++){
      d[i][j]=(v[i]+v[j])/2.0;
    }
  }
  
  for(i=0;i<N;i++){
    cost[i]=maxpath(i,N);
    if(max<cost[i]) max=cost[i];
  }
  
  printf("%f\n",nmax);
  
  
  return 0;
}

double max(double a, double b){
  if(a>=b){
    return a;
  }else{
    return b;
  }
}

double maxpath(int s,int N){
  int u,w,used[52],i,j;
  
  for(i=0;i<N;i++){
    value[i]=-100000000.0;
    used[i]=0;
  }
  value[s]=0.0;
  
    for(;;){
    w=-1;
    for(u=0;u<N;u++){
      if(used[u]==0 && (w=-1 || value[u]>value[w])) w=u;
    }
    if(w==-1) break;
    
    used[w]=1;
    
    for(u=0;u<N;u++){
        if(value[u]<d[w][u]){
          value[u]=d[w][u];
          v[u]=(v[u]+v[w])/2.0;
          v[w]=(v[u]+v[w])/2.0;
          for(i=0;i<N;i++){
            for(j=0;j<i;j++){
              d[i][j]=(v[i]+v[j])/2.0;
            }
          }
      	}
      
    }
  }
  
  return value[s];
  


Compiler output:
main.c: In function 'main':
main.c:33:11: error: invalid operands to binary < (have 'double (*)(double,  double)' and 'double')
   33 |     if(max<cost[i]) max=cost[i];
      |        ~~~^~~~~~~~
      |        |       |
      |        |       double
      |        double (*)(double,  double)
main.c:33:24: error: lvalue required as left operand of assignment
   33 |     if(max<cost[i]) max=cost[i];
      |                        ^
main.c: In function 'maxpath':
main.c:83:3: error: expected declaration or statement at end of input
   83 |   return value[s];
      |   ^~~~~~
Language: C

#include<stdio.h>
#include <stdlib.h>
void qsort(
	void* base, size_t num, size_t size,
	double (*compare)(const void* a, const void* b)
);
int asc(const void* a, const void* b) {
	return *(double*)a - *(double*)b;
}
int main(void) {
	int n;
	scanf("%d", &n);
	double v[10000];

	for (int i = 0; i < n; i++) {
		scanf("%lf", &v[i]);
	}
	qsort(v, sizeof(v) / sizeof(double), sizeof(double), asc);
	//for (int i = 0; i < n; i++) {
		//printf("%lf\n", v[i]);
	//}

	double sum = 0;
	int cnt = 0;
	double ans = (v[0] + v[1]) / 2;
	//printf("%lf\n", ans);
	for (int i = 2; i < n; i++) {
		ans = (ans + v[i]) / 2;
		//printf("sum=%lf\n", sum);
		/*if (cnt == 2) {
			ans = sum / 2;
			sum = 0;
			cnt = 0;
			//printf("%.1f\n", ans);
		}*/
	}

	//if (n % 2 != 0) {
		//ans = (ans + v[n - 1]) / 2;
	//}
	printf("%.1f\n", ans);
	return 0;
}


Compiler output:
main.c:3:6: error: conflicting types for 'qsort'; have 'void(void *, size_t,  size_t,  double (*)(const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  double (*)(const void *, const void *))'}
    3 | void qsort(
      |      ^~~~~
In file included from main.c:2:
/usr/include/stdlib.h:970:13: note: previous declaration of 'qsort' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *))'}
  970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |             ^~~~~
main.c: In function 'main':
main.c:18:62: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   18 |         qsort(v, sizeof(v) / sizeof(double), sizeof(double), asc);
      |                                                              ^~~
      |                                                              |
      |                                                              int (*)(const void *, const void *)
main.c:5:18: note: expected 'double (*)(const void *, const void *)' but argument is of type 'int (*)(const void *, const void *)'
    5 |         double (*compare)(const void* a, const void* b)
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

void swap (double v[], int i, int j){
	double tmp = v[i];
  	v[i] = v[j];
  	v[j] = tmp;
}

void sort (double v[], int n){
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n-1; j++)
      if (v[j+1] < v[j])
        swap (v, j, j+1);
}

int main(){
  
  int N,count = 0;
  cin >> N;
  double v[N],blend,sum;
  for (int i = 0; i < N; i++)
    cin >> v[i];
  
  sort (v, N);
  
  for(int i = 1; i < N; i++){
    if(v[i]%v[0] == 0)
      count++;
  }
  
  if (count = N)
    blend = v[0];
   else if (N == 2)
   blend = (v[0]+v[1])/2;
  
  else if (N >= 3){
	for(int i = 1; i < N; i++){
      if (i == 1){
        blend = (v[0]+v[1])/2;
        sum = blend;
        blend = 0;
      }
      else {
        blend += (sum + v[i])/2;
        sum = blend;
      }
    }    
  }
  cout << blend << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   28 |     if(v[i]%v[0] == 0)
      |        ~~~~^~~~~
      |           |    |
      |           |    double
      |           double
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n;cin >> n;
    int m = n;
    double a[n];double ans;
    for(int i = 0;i < n;i++)cin >> a[i];
    float min1 = 99999,min2 = 99999,index1,index2;
    while(m > 1)
    {
        min1 = 99999;min2 = 99999;
        for(int i = 0;i < n;i++)
        {
            if(min1 > a[i])
            {
                min1 = a[i];
                index1 = i;
            }
        }
        int fixer = a[index1];
        a[index1] = 999999;
        for(int i = 0;i < n;i++)
        {
            if(min2 > a[i])
            {
                min2 = a[i];
                index2 = i;
            }
        }
        cout << min1 << " " << min2 << endl;
        a[index1] = fixer;
        ans = min1 + min2;
        ans = ans/ 2;
        if(index1 < index2){
                a[index1] = ans;
                a[index2] = 99999;
        }
        else {
                a[index2] = ans;
                a[index1] = 99999;
        }
        for(int i = 0;i < n;i++)cout << a[i] << " ";
        cout << endl;
        m--;
    }
    cout << ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: invalid types 'double [n][float]' for array subscript
   21 |         int fixer = a[index1];
      |                      ^
a.cc:22:10: error: invalid types 'double [n][float]' for array subscript
   22 |         a[index1] = 999999;
      |          ^
a.cc:32:10: error: invalid types 'double [n][float]' for array subscript
   32 |         a[index1] = fixer;
      |          ^
a.cc:36:18: error: invalid types 'double [n][float]' for array subscript
   36 |                 a[index1] = ans;
      |                  ^
a.cc:37:18: error: invalid types 'double [n][float]' for array subscript
   37 |                 a[index2] = 99999;
      |                  ^
a.cc:40:18: error: invalid types 'double [n][float]' for array subscript
   40 |                 a[index2] = ans;
      |                  ^
a.cc:41:18: error: invalid types 'double [n][float]' for array subscript
   41 |                 a[index1] = 99999;
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
  int main(){
    int N;
    cin >> N;
    int nabe;
    int g;
    int f;
    int h;
    int sum = 0;
    double ans = 0;
    double cash;
    double cash2;
    double cash3;
    int n;
    if(N%2 == 0){
      n = N/2;
    for(int i = 0 , i < n , i++){
    	cin >> g;
        sum = sum + g;
      }
      ans = sum/2;
      cout << ans;
    }
    if(N%3==0){
     n = N/3;
      for(int i = 0,i < n , i++){
      cin >> g;
      cin >> f;
        sum = g+h;
        cash = sum/2;
        cin >> h;
        cash2 = cash + h;
        cash3 = cash2/2;
        ans +=cash3;
      }
      cout << ans;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: expected ';' before '<' token
   18 |     for(int i = 0 , i < n , i++){
      |                      ^~
      |                      ;
a.cc:18:23: error: expected primary-expression before '<' token
   18 |     for(int i = 0 , i < n , i++){
      |                       ^
a.cc:18:32: error: expected ';' before ')' token
   18 |     for(int i = 0 , i < n , i++){
      |                                ^
      |                                ;
a.cc:27:22: error: expected ';' before '<' token
   27 |       for(int i = 0,i < n , i++){
      |                      ^~
      |                      ;
a.cc:27:23: error: expected primary-expression before '<' token
   27 |       for(int i = 0,i < n , i++){
      |                       ^
a.cc:27:32: error: expected ';' before ')' token
   27 |       for(int i = 0,i < n , i++){
      |                                ^
      |                                ;
Language: C++

#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
  int N;
  cin >> N;
  double v[N];
  for(int i = 0; i < N; i++) cin >> v[i];

  sort(v,v + N);

  for(int i = 0; i < N - 1; i++){
    v[i + 1] = (v[i] + v[i + 1]) / 2;
  }

  cout << v[N - 1];


}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(v,v + N);
      |   ^~~~
      |   short
Language: C

#include <stdio.h>

int main(){
  int n;
  double sum[];
  int v[1001];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&v[i]);
  }
  
  for(int k=0;k<n;k++){
  for(int i=k;i<n;i++){
    sum+=(double) (2*(i-2))*v[i]; 
  }
  sum = sum/(2*(n-1));
  }


  printf("%lf\n",sum);
  
  
  
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:5:10: error: array size missing in 'sum'
    5 |   double sum[];
      |          ^~~
main.c:14:8: error: assignment to expression with array type
   14 |     sum+=(double) (2*(i-2))*v[i];
      |        ^~
main.c:16:12: error: invalid operands to binary / (have 'double *' and 'int')
   16 |   sum = sum/(2*(n-1));
      |         ~~~^~~~~~~~~~
      |         |     |
      |         |     int
      |         double *
Language: C++

#include<iostream>
#include <cstdlib>
using namespace std;
int main()
{
  int N;
  cin >> N;
  double v[N];
  for(int i = 0; i < N; i++) cin >> v[i];

  sort(v,v + N);

  for(int i = 0; i < N - 1; i++){
    v[i + 1] = (v[i] + v[i + 1]) / 2;
  }

  cout << v[N - 1];


}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(v,v + N);
      |   ^~~~
      |   short
Language: C++

#include<stdio.h>
#include<cstdlib>
#include<iostream>
#include<string>
#include<sstream>

using namespace std;

int main(){
    int N;
    cin >> N;

    int v[N];

    for (int i = 0; i < N; i++){
        cin >> v[i];
        if(i>0){
            for(int j = 1; j < i+1; j++){
                if(v[i-j] > v[i-j+1]){
                    //swap(v[i-j],v[i]);
                    int a,b;
                    a=v[i-j];
                    b=v[i-j+1];
                    v[i-j]=b;
                    v[i-j+1]=a;
                }
                else{
                    break;
                }
            }
        }
    }

    for (int i = 0; i < N; i++){
        cout << v[i] <<"\t";
    }
    

    double ans = v[0]*pow(0.5,N-1);
    for (int i = 0; i < N-1; i++){
        ans += v[i+1]*pow(0.5,N-i-1);
    }
    cout << ans <<endl;
    
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:23: error: 'pow' was not declared in this scope
   39 |     double ans = v[0]*pow(0.5,N-1);
      |                       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
   int a[101];
  vector<float>vect;
 cin>>n;
 
 for(int i=0;i<n;i++)
 {  cin>>a[i];
  vect.push_back(a[i]);
 }
  sort(vect.begin(),vect.end());
 while(vect.size()!=1)
 {
     sort(vect.begin(),vect.end());
   float x=vect[0];
   float y=vect[1];
   vect.push_back((float)((x+y)/2));
   vect.pop_front();
   vect.pop_front();
 }
  cout<<vect.front()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'class std::vector<float>' has no member named 'pop_front'
   21 |    vect.pop_front();
      |         ^~~~~~~~~
a.cc:22:9: error: 'class std::vector<float>' has no member named 'pop_front'
   22 |    vect.pop_front();
      |         ^~~~~~~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a;
    int a[n+1];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    float temp=a[0];
    for(int i=1;i<n;i++)
    {
       float t=(float)(temp+a[i])/2;
       temp=t;
    }
    cout<<t<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'n' was not declared in this scope
    8 |     int a[n+1];
      |           ^
a.cc:11:15: error: invalid types 'int[int]' for array subscript
   11 |         cin>>a[i];
      |               ^
a.cc:14:17: error: invalid types 'int[int]' for array subscript
   14 |     float temp=a[0];
      |                 ^
a.cc:17:30: error: invalid types 'int[int]' for array subscript
   17 |        float t=(float)(temp+a[i])/2;
      |                              ^
a.cc:20:11: error: 't' was not declared in this scope
   20 |     cout<<t<<endl;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
   
  vector<float>vect;
 cin>>n;
 
 for(int i=0;i<n;i++)
 { 
  float y;
   cin>>y;
  vect.push_back(y);
 }
  sort(vect.begin(),vect.end());
 while(vect.size()!=1)
 {
     sort(vect.begin(),vect.end());
   float x=vect[0];
   float y=vect[1];
   vect.push_back((float)(x+y)/2);
   vect.pop_front();
   vect.pop_front();
 }
  cout<<vect.front()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'class std::vector<float>' has no member named 'pop_front'
   23 |    vect.pop_front();
      |         ^~~~~~~~~
a.cc:24:9: error: 'class std::vector<float>' has no member named 'pop_front'
   24 |    vect.pop_front();
      |         ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
   int a[101];
  vector<float>vect;
 cin>>n;
 
 for(int i=0;i<n;i++)
 {  cin>>a[i];
  vect.push_back(a[i]);
 }
  sort(vect.begin(),vect.end());
 while(vect.size()!=1)
 {
     sort(vect.begin(),vect.end());
   float x=vect[0];
   float y=vect[1];
   vect.push_back((float)(x+y)/2);
   vect.pop_front();
   vect.pop_front();
 }
  cout<<vect.front()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'class std::vector<float>' has no member named 'pop_front'
   21 |    vect.pop_front();
      |         ^~~~~~~~~
a.cc:22:9: error: 'class std::vector<float>' has no member named 'pop_front'
   22 |    vect.pop_front();
      |         ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  vector<int>vect;
 cin>>n;
  int a[101];
 for(int i=0;i<n;i++)
 {  cin>>a[i];
  vect.push_back(a[i]);
 }
  sort(vect.begin(),vect.end());
 while(vect.size()!=1)
 {
     sort(vect.begin(),vect.end());
   int x=vect[0];
   int y=vect[1];
   vect.push_back((x+y)/2);
   vect.pop_front();
   vect.pop_front();
 }
  cout<<vect.front()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'class std::vector<int>' has no member named 'pop_front'
   20 |    vect.pop_front();
      |         ^~~~~~~~~
a.cc:21:9: error: 'class std::vector<int>' has no member named 'pop_front'
   21 |    vect.pop_front();
      |         ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
int N;
 cin>>N;
  vector<float> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
int i=0
while(i<N-1){
     sort(vec.begin(), vec.end());
   vec.at(0)=vec.at(0)/2+vec.at(1)/2;
 }
  cout<<vec.at(0)<<endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: expected ',' or ';' before 'while'
   12 | while(i<N-1){
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{int n;
 cin>>n;
 int a[n];
 float s=0.0;
 for(int i=0;i<n;i++)
 cin>>a[i];
 sort(a,a+n);
 for(int i=1;i<n;i++)
 s=s+(float)((pow(2,i-1))a[i]);
 s=(float)(s+a[0])/pow(2,n-1);
 cout<<s;
return 0;}             
             

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ')' before 'a'
   12 |  s=s+(float)((pow(2,i-1))a[i]);
      |             ~            ^
      |                          )
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<float> v(n);
  for(int i=0; i<n; i++) cin >> v[i];
  for(int i=0; i<n-1; i++){
    float a = *min_element(v.begin(), v.end());
    v.erase(min_element(v.begin(), v.end()));
    float b = *min_element(v.begin(), v.end());
    v.erase(min_element(v.begin(), v.end()));
    v.push_back((float)(a+b)/2);
  }
  cout << v.front() << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'min_element' was not declared in this scope
   11 |     float a = *min_element(v.begin(), v.end());
      |                ^~~~~~~~~~~
Language: C++

int main() {
        int n;
        cin >> n;
        double numArr[n];
        int index = 0;
        while (n != index) {
          int input;
      cin >> input;
      numArr[index] = input;
      index += 1;
    }

        sort(numArr, numArr + n);

        for (int i = 0; i < n-1; ++i) {
        double first = numArr[i] + numArr[i+1];
        numArr[i+1] = first / 2;
    }
        cout << numArr[n-1];

        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n;
      |         ^~~
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |         sort(numArr, numArr + n);
      |         ^~~~
      |         short
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << numArr[n-1];
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  vector<int> v(N);
  
  for (int i = 0; i < N; i++) {
    cin >> v[i];
  }
  
  sort(v.begin(), v.end());
  
  for (int i = 0; i < N-1; i++) {
    if (i == 0) double avg = v[0];
    
    avg = ( ((double) avg)+((double) v[i+1]) )/2;
  }
  
  cout << avg << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'avg' was not declared in this scope
   17 |     avg = ( ((double) avg)+((double) v[i+1]) )/2;
      |     ^~~
a.cc:20:11: error: 'avg' was not declared in this scope
   20 |   cout << avg << endl;
      |           ^~~
Language: C

#include<stdio.h>
#include <stdlib.h>
void qsort(
	void* base, size_t num, size_t size,
	double (*compare)(const void* a, const void* b)
);
int asc(const void* a, const void* b) {
	return *(double*)a - *(double*)b;
}
int main(void) {
	int n;
	scanf("%d", &n);
	double v[10000];

	for (int i = 0; i < n; i++) {
		scanf("%lf", &v[i]);
	}
	qsort(v, sizeof(v) / sizeof(double), sizeof(double), asc);
	//for (int i = 0; i < n; i++) {
		//printf("%lf\n", v[i]);
	//}

	double sum=0;
	int cnt = 0;
	double ans = (v[0] + v[1]) / 2;
	//printf("%lf\n", ans);
	for (int i = 2; i < n; i++) {
		ans = (ans + v[i]) / 2;
		//printf("sum=%lf\n", sum);
		/*if (cnt == 2) {
			ans = sum / 2;
			sum = 0;
			cnt = 0;
			//printf("%.1f\n", ans);
		}*/
	}
	
	//if (n % 2 != 0) {
		//ans = (ans + v[n - 1]) / 2;
	//}
	printf("%.1f\n", ans);
	return 0; 
}

Compiler output:
main.c:3:6: error: conflicting types for 'qsort'; have 'void(void *, size_t,  size_t,  double (*)(const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  double (*)(const void *, const void *))'}
    3 | void qsort(
      |      ^~~~~
In file included from main.c:2:
/usr/include/stdlib.h:970:13: note: previous declaration of 'qsort' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *))'}
  970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |             ^~~~~
main.c: In function 'main':
main.c:18:62: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   18 |         qsort(v, sizeof(v) / sizeof(double), sizeof(double), asc);
      |                                                              ^~~
      |                                                              |
      |                                                              int (*)(const void *, const void *)
main.c:5:18: note: expected 'double (*)(const void *, const void *)' but argument is of type 'int (*)(const void *, const void *)'
    5 |         double (*compare)(const void* a, const void* b)
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
int N;
  vector<float> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(), vec.end());
 for(int i=0;i<N-1;i++){
   vec.at(i)=vec.at(i)/2+vec.at(i+1)/2
 }
  cout<<vec.at(N-1)<<endl;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:12:39: error: expected ';' before '}' token
   12 |    vec.at(i)=vec.at(i)/2+vec.at(i+1)/2
      |                                       ^
      |                                       ;
   13 |  }
      |  ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{int n;
 cin>>n;
 int a[n];
 float s=0.0;
 for(int i=0;i<n;i++)
 cin>>a[i];
 sort(a.begin(),a.end());
 for(int i=1;i<n;i++)
 s=s+(float)((pow(2,i-1))a[i]);
 s=(float)(s+a[0])/pow(2,n-1);
 cout<<s;
return 0;}             
             

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   10 |  sort(a.begin(),a.end());
      |         ^~~~~
a.cc:10:19: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   10 |  sort(a.begin(),a.end());
      |                   ^~~
a.cc:12:26: error: expected ')' before 'a'
   12 |  s=s+(float)((pow(2,i-1))a[i]);
      |             ~            ^
      |                          )
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
double a[110],res = 0;
int main(){
	int i,n;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> a[i];
	}
	sort(a,a + n);
	res = a[0];
	for(i=1;i<n;i++){
		res += (res + a[i])/2;
	}
	cout << res << endl;
	

Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: expected '}' at end of input
   16 |         cout << res << endl;
      |                             ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{int n;
 cin>>n;
 int a[n];
 float s=0.0;max=0.0;
 for(int i=0;i<n;i++)
 cin>>a[i];
 sort(a.begin(),a.end());
 for(int i=1;i<n;i++)
 s=s+(float)((pow(2,i-1)a[i]);
 s=(float)(s+a[0])/pow(2,n-1);
 cout<<s;
return 0;}             
             

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: overloaded function with no contextual type information
    7 |  float s=0.0;max=0.0;
      |                  ^~~
a.cc:10:9: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   10 |  sort(a.begin(),a.end());
      |         ^~~~~
a.cc:10:19: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   10 |  sort(a.begin(),a.end());
      |                   ^~~
a.cc:12:25: error: expected ')' before 'a'
   12 |  s=s+(float)((pow(2,i-1)a[i]);
      |              ~          ^
      |                         )
a.cc:12:30: error: expected ')' before ';' token
   12 |  s=s+(float)((pow(2,i-1)a[i]);
      |             ~                ^
      |                              )
Language: C++

##include <bits/stdc++.h>

using namespace std;

int main (){
	int n;
  	double t=0.0;
  
  	cin>>n;
  
  	vector<int> v(n);
   
  	for(int i=0;i<n;i++){
    	cin>>v.at(i);
     }
	sort(v.begin(), v.end());
  	
  	for(int i=0;i<n-1;i++){
    	t=((double)v.at(i)+(double)v.at(i+1))/2.0;
      	v.at(i+1)=t;
    	
    }
  	 cout << fixed << setprecision(50);
  	 cout<<t<<endl;
}

Compiler output:
a.cc:1:1: error: stray '##' in program
    1 | ##include <bits/stdc++.h>
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##include <bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin>>n;
      |         ^~~
a.cc:11:9: error: 'vector' was not declared in this scope
   11 |         vector<int> v(n);
      |         ^~~~~~
a.cc:11:16: error: expected primary-expression before 'int'
   11 |         vector<int> v(n);
      |                ^~~
a.cc:14:14: error: 'v' was not declared in this scope
   14 |         cin>>v.at(i);
      |              ^
a.cc:16:14: error: 'v' was not declared in this scope
   16 |         sort(v.begin(), v.end());
      |              ^
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |         sort(v.begin(), v.end());
      |         ^~~~
      |         short
a.cc:23:10: error: 'cout' was not declared in this scope
   23 |          cout << fixed << setprecision(50);
      |          ^~~~
a.cc:23:18: error: 'fixed' was not declared in this scope
   23 |          cout << fixed << setprecision(50);
      |                  ^~~~~
a.cc:23:27: error: 'setprecision' was not declared in this scope
   23 |          cout << fixed << setprecision(50);
      |                           ^~~~~~~~~~~~
a.cc:24:19: error: 'endl' was not declared in this scope
   24 |          cout<<t<<endl;
      |                   ^~~~
Language: C++

#include<iostream>
#include <algorithm>
using namespace std;

int main() {
  	int n;
  	cin >> n;
  	double numArr[n];
  	int index = 0;
  	while (n != index) {
	  int input;
      cin >> input;
      numArr[index] = input;
      index += 1;
    }
	
  	sort(numArr, numArr + n);
  	
  	for (int i = 0; i < n-1; ++i) {
      	double first = numArr[i] + numArr[i+1]
    	numArr[i+1] = first / 2
    }
  	cout << numArr[n];
  
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: expected ',' or ';' before 'numArr'
   21 |         numArr[i+1] = first / 2
      |         ^~~~~~
Language: Java

import java.util.*;
import java.util.Collections;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 入力
		int a = sc.nextInt();
      　ArrayList<Integer> list = new ArrayList<>();
      double result = 0;
      for (int i = 0; i < a; i++){
        list.add(sc.nextInt());
      }
      
      Colletions.sort(list);
      result = list(0);
      for(int i = 1; i < a; i++){

        result = (result + list(i))/2;
      }
      　System.out.println(result);
	}
}

Compiler output:
Main.java:8: error: illegal character: '\u3000'
      ?ArrayList<Integer> list = new ArrayList<>();
      ^
Main.java:20: error: illegal character: '\u3000'
      ?System.out.println(result);
      ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
int N;
  vector<float> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(), vec.end());
  float a=0;
  for(int i=0;i<N;i++){
   a+=vec.at(i)*std::pow(1/2,N+1-i);
  }
  cout<<a+vec.at(0)*std::pow(1/2,N+1);<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: expected primary-expression before '<<' token
   15 |   cout<<a+vec.at(0)*std::pow(1/2,N+1);<<endl;
      |                                       ^~
Language: Java

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
Double U[] = new Double[N];
for(int i=0;i<N;i++){
int S = sc.nextInt();
U[i] = S;
}
double f = U[0];
Arrays.sort(U);
for(int i=1;i<N;i++){
f=f+U[i];
f=f/2;
}
System.out.println("f");
}
}


Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to Double
U[i] = S;
       ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        float a[] = new Float[n];
        for(int i = 0; i < n; i++){
            a[i] = sc.nextFloat();
        }
        float tmp = 0;
        for(i = 0; i < n; i++){
            for(int j = i + 1; j < n; j++){
                if(a[i] > a[j]){
                    tmp = a[i];
                    a[i] = a[j];
                    a[j] = tmp;
                }
            }
        }
        float r = (a[i] + a[i + 1]) / 2;
        for(int i = 2; i < n; i++){
            r = (r + a[i]) / 2;
        }
        System.out.println(r);
    }
}

Compiler output:
Main.java:6: error: incompatible types: Float[] cannot be converted to float[]
        float a[] = new Float[n];
                    ^
Main.java:11: error: cannot find symbol
        for(i = 0; i < n; i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:11: error: cannot find symbol
        for(i = 0; i < n; i++){
                   ^
  symbol:   variable i
  location: class Main
Main.java:11: error: cannot find symbol
        for(i = 0; i < n; i++){
                          ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
            for(int j = i + 1; j < n; j++){
                        ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
                if(a[i] > a[j]){
                     ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
                    tmp = a[i];
                            ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
                    a[i] = a[j];
                      ^
  symbol:   variable i
  location: class Main
Main.java:20: error: cannot find symbol
        float r = (a[i] + a[i + 1]) / 2;
                     ^
  symbol:   variable i
  location: class Main
Main.java:20: error: cannot find symbol
        float r = (a[i] + a[i + 1]) / 2;
                            ^
  symbol:   variable i
  location: class Main
10 errors
Language: Java

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
Float U[] = new Float[N];
for(int i=0;i<N;i++){
U[i] = sc.nextInt();
}
float f = U[0];
Arrays.sort(U);
for(int i=1;i<N;i++){
f=f+U[i];
f=f/2;
}
System.out.println("f");
}
}


Compiler output:
Main.java:8: error: incompatible types: int cannot be converted to Float
U[i] = sc.nextInt();
                 ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main (){
	int n;
  	
  	double t=0.0;
  
  	cin>>n;
  
  	vector<int> v(n);
   
  	for(int i=0;i<n;i++){
    	cin>>v.at(i);
     }
	sort(v.begin(), v.end());
  	
  	for(int i=0;i<n-1;i++){
    	t=((double)v.at(i)+(double)v.at(i+1))/2.0
      	v.at(i+1)=t;
    	
    }
  	 cout << fixed << setprecision(20);
  	cout<<t<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:50: error: expected ';' before 'v'
   20 |         t=((double)v.at(i)+(double)v.at(i+1))/2.0
      |                                                  ^
      |                                                  ;
   21 |         v.at(i+1)=t;
      |         ~