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

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

int main() {
  int N; //入力の個数
  cin >> N;
  
  int M; //最大値を保持する変数
  int S; //求める合計値
  
  for (int i=0; i<N; i++) {
    int p;
    cin >> p; //入力
    S += p;
    M = max(p,M);　//最大値を更新
  }
  cout << S - M/2 << endl;
}

Compiler output:
a.cc:15:18: error: extended character 　 is not valid in an identifier
   15 |     M = max(p,M);　//最大値を更新
      |                  ^
a.cc: In function 'int main()':
a.cc:15:18: error: '\U00003000' was not declared in this scope
   15 |     M = max(p,M);　//最大値を更新
      |                  ^~
Language: C++

#include <iostream>

int main(){
    int N,sum=0,max=0;cin>>N;
    int *p=(int*)malloc(sizeof(int)*N);
    for(int i=0; i<N; i++){
        std::cin>>p[i];
        sum+=p[i];
        if(max<p[i])
            max=p[i];
    }
    std::cout<<sum-max/2;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:23: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     int N,sum=0,max=0;cin>>N;
      |                       ^~~
      |                       std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,p,i,max=0,sum,x;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&p);
		if(max<p[i]){
			max=p[i];
		}
		sum=sum+p;
	}
	x=max/;
	sum=sum-x;
	printf("%\n",&sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: invalid types 'int[int]' for array subscript
    8 |                 if(max<p[i]){
      |                         ^
a.cc:9:30: error: invalid types 'int[int]' for array subscript
    9 |                         max=p[i];
      |                              ^
a.cc:13:15: error: expected primary-expression before ';' token
   13 |         x=max/;
      |               ^
Language: C++

#include<stdio.h>
int main(void)
{
	int n,p,i,max=0,sum;x;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&p);
		if(max<p[i]){
			max=p[i];
		}
		sum=sum+p;
	}
	x=max/;
	sum=sum-x;
	printf("%\n",&sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:29: error: 'x' was not declared in this scope
    4 |         int n,p,i,max=0,sum;x;
      |                             ^
a.cc:8:25: error: invalid types 'int[int]' for array subscript
    8 |                 if(max<p[i]){
      |                         ^
a.cc:9:30: error: invalid types 'int[int]' for array subscript
    9 |                         max=p[i];
      |                              ^
a.cc:13:15: error: expected primary-expression before ';' token
   13 |         x=max/;
      |               ^
Language: Java

package archiveBeginner;

import java.util.Scanner;

public class XmasEve {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		//個数Nに応じた商品の価格を配列に格納していく
		int[]  price = new int[N];

		//個数N個における商品の合計金額
		int total = 0;
		int maxPrice = 0;

		for(int i = 0 ; i<price.length ; i++) {

			//for文を使って配列に値を入力していく
			price[i] = sc.nextInt();

			System.out.println(i+1 + "つ目の商品お値段" + price[i] + "円");

			total += price[i];

			//最高価格の抽出
			if(price[i] >= maxPrice ) {
				maxPrice = price[i];
			}else {
				maxPrice = maxPrice;
			}
		}
			 int answer = total - maxPrice/2 ;

			System.out.println("答えは" + answer + "円" );

	}
}


Compiler output:
Main.java:5: error: class XmasEve is public, should be declared in a file named XmasEve.java
public class XmasEve {
       ^
1 error
Language: C

#pragma GCC optimize("O3")
#pragma GCC target("sse4")

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	int N;
	cin >> N;

	int a[N];
	int sum = 0;
	for(int i = 0; i < N; i++) {
		cin >> a[i];
		sum += a[i];
	}

	int maxi = *max_element(a, a + N);
	cout << sum - maxi/2 << endl;
	return 0;
}

Compiler output:
main.c:4:10: fatal error: bits/stdc++.h: No such file or directory
    4 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int N;
	cin >> N;
	
	int sum = 0; max = 0, tmp;
	for (int i = 0; i < N; ++i)
	{
		cin >> tmp;
		sum += tmp;
		if (tmp > max) max = tmp;
	}
	
	cout << sum - max / 2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: overloaded function with no contextual type information
    9 |         int sum = 0; max = 0, tmp;
      |                            ^
a.cc:9:31: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    9 |         int sum = 0; max = 0, tmp;
      |                               ^~~
      |                               tm
a.cc:17:27: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
   17 |         cout << sum - max / 2;
      |                       ~~~~^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
	int sum=0,a,i,j,d[];
	scanf("%d",&a);
	for(i=0;i < n; i++){
		scanf("%d",&d[i]);
	}
  /* ソート処理 */
	for (i=0; i<a; ++i) {
    for (j=i+1; j<a; ++j) {
      if (d[i] > d[j]) {
        sum =  number[i];
        number[i] = number[j];
        number[j] = sum;
      }
    }
  }
  sum =0;
  d[a-1] = d[a-1]/2;
  for(i=0;i<a ;i++){
  	sum += d[i];
  }
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:5:25: error: array size missing in 'd'
    5 |         int sum=0,a,i,j,d[];
      |                         ^
main.c:7:21: error: 'n' undeclared (first use in this function)
    7 |         for(i=0;i < n; i++){
      |                     ^
main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:16: error: 'number' undeclared (first use in this function)
   14 |         sum =  number[i];
      |                ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int int_sort( const void * a , const void * b ) {
  /* 引数はvoid*型と規定されているのでint型にcastする */
  if( *( int * )a < *( int * )b ) {
    return -1;
  }
  else
  if( *( int * )a == *( int * )b ) {
    return 0;
  }
  return 1;
}
int main(int argc, char const *argv[])
{
	int sum=0,a,i,d[];
	scanf("%d",&a);
	for(i=0;i < n; i++){
		scanf("%d",&d[i]);
	}
  /* ソート処理 */
  qsort(( void * )d , a , sizeof( d[0] ) , int_sort );
  d[a-1] = d[a-1]/2;
  for(i=0;i<a ;i++){
  	sum += d[i];
  }
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:16:23: error: array size missing in 'd'
   16 |         int sum=0,a,i,d[];
      |                       ^
main.c:18:21: error: 'n' undeclared (first use in this function)
   18 |         for(i=0;i < n; i++){
      |                     ^
main.c:18:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

#define OnlineJudge1

#define loop(a,n) for(int i = a;i<n;i++)
#define NumofDigits(n) ((int)log10(n)+1)
#define CountofNumber(array,n,x)  (upper_bound(array, array+n, x)-lower_bound(array, array+n, x))
#define readline(s) getline(cin,s)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define EPS 1e-7
#define modulo ll (1e9 + 7)


typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
    #ifdef OnlineJudge
        freopen("in.in","r",stdin);
        freopen("out.txt","w",stdout);
    #endif
}
int main(){
    init();
ll n,sum = 0,mx = 0;
cin >> n;
for(int i = 0;i < n;i++){
int x;
cin >> x;
sum+=x;
mx = max(mx,x);
}
sum -= (mx/2);
cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: no matching function for call to 'max(ll&, int&)'
   38 | mx = max(mx,x);
      |      ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:38:9: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   38 | mx = max(mx,x);
      |      ~~~^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:38:9: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   38 | mx = max(mx,x);
      |      ~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>

int main() {
    int N;
    std::cin >> N;
    
    int temp;
    std::vector<int> p;
    for (int i=0; i<N; ++i) {
        std::cin >> temp;
        p.push_back(temp); 
    }
    std::sort(p.begin(), p.end());
    
    int ans = 0;
    for (auto &&e : p) {
        ans += e;
    }
    
    ans -= p.back() / 2;
    std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   14 |     std::sort(p.begin(), p.end());
      |          ^~~~
      |          qsort
Language: C++

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

int main(){
  	int n;
  	cin >> n;
  
  	cout << "Christmas";
  	n = 25 - n;
  
  	rep(i,0,n){
      cout << " Eve";
    }
  
  cout << endl;
  
	return 0; 
}


Compiler output:
a.cc:2:15: error: expected parameter name, found "0"
    2 | #define rep(i,0,n) for(int i = 0;i < n;i++)
      |               ^
a.cc: In function 'int main()':
a.cc:13:13: error: 'i' was not declared in this scope
   13 |         rep(i,0,n){
      |             ^
a.cc:13:9: error: 'rep' was not declared in this scope
   13 |         rep(i,0,n){
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int a;
    vector<int> data;
    cin >> a;
    for (int i=0;i<a;i++){
      cin >> data.at(i);
    }
    sort(data.begin(), data.end());
    int s = 0;
    for (int i=0;i<a;i++){
      s += data.at(i);
    }
    s -= data.end()/2;
    cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> data;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> data;
      |            ^~~
a.cc:10:19: error: overloaded function with no contextual type information
   10 |       cin >> data.at(i);
      |                   ^~
a.cc:12:15: error: overloaded function with no contextual type information
   12 |     sort(data.begin(), data.end());
      |               ^~~~~
a.cc:12:29: error: overloaded function with no contextual type information
   12 |     sort(data.begin(), data.end());
      |                             ^~~
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(data.begin(), data.end());
      |     ^~~~
      |     short
a.cc:15:17: error: overloaded function with no contextual type information
   15 |       s += data.at(i);
      |                 ^~
a.cc:17:15: error: overloaded function with no contextual type information
   17 |     s -= data.end()/2;
      |               ^~~
Language: C++

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };



signed main() {
	int i, j;
	int n;
	vector<int>list;

	cin >> n;

	for (i = 0; i < n; i++) {
		int num;
		cin >> num;
		list.push_back(num);
	}

	sort(list.begin(), list.end()), greater<int>());

	int sum = list[0] / 2;

	for (i = 1; i < n; i++) {
		sum += list[i];
	}
	cout << sum << endl;


	









	getchar();
	getchar();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:55: error: expected ';' before ')' token
   60 |         sort(list.begin(), list.end()), greater<int>());
      |                                                       ^
      |                                                       ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,max=-1;
	cin>>n;
	int sum=0;
	for(int i=0;i<n;i++)
	{
		int add;
		cin>>add);
		sum+=add;
		max=max>add?max:add;
	}
	cout<<sum-max/2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before ')' token
   11 |                 cin>>add);
      |                         ^
      |                         ;
Language: C++

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

int main(){
  int N;
  cin >> N;
  int M = 0, S = 0;

  for (int i = 0; i < N; i++){
    int P;
    cin >> P;
    M += P;
    S = max(P,M);
  }
  ans = M - (S/2);
  cout << ans <<endl;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   ans = M - (S/2);
      |   ^~~
      |   abs
Language: Java

public class Main {

	public static void main(String[] args) {
		ArrayList<Integer> input = new ArrayList<Integer>();
		int max = 0;
		int price = 0;
		int count = 0;
		int sum = 0;

		Scanner scanner = new Scanner(System.in);
		System.out.print("Input > ");
		int x = scanner.nextInt();

		for (int i = 0; i < x; i++) {
			price = scanner.nextInt();
			input.add(price);
			if (max < price) {
				max = price;
				count = i;
			}
		}

		for (int i = 0; i < x; i++) {
			if (i == count) {
				sum = sum + input.get(i) / 2;
			} else {
				sum = sum + input.get(i);
			}
		}

		System.out.println(sum);
	}

}


Compiler output:
Main.java:4: error: cannot find symbol
		ArrayList<Integer> input = new ArrayList<Integer>();
		^
  symbol:   class ArrayList
  location: class Main
Main.java:4: error: cannot find symbol
		ArrayList<Integer> input = new ArrayList<Integer>();
		                               ^
  symbol:   class ArrayList
  location: class Main
Main.java:10: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
4 errors
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define int long long
int mod=1e9+7;
const int N_MAX=1e5*2+1;

signed main(){
  int n;
  cin>>n;
  int ans=0;
  int m=0;
  for(int i=0;i<n;i++){
    int a;
    cin>>a;
    m=max(a,m);
    ans+=a;
  }
  cout<<a-m/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'a' was not declared in this scope
   18 |   cout<<a-m/2<<endl;
      |         ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

#define ll long long int
#define vi vector<int>
#define endl "\n"

int main() {
  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  int n, sum = 0; cin >> n;
  int maxv = INT_MIN;
  for (int i= 0; i < n; ++i) {
    int t; cin >> t;
    sum += t;
    maxv = max(maxv, t);
  }
  sum -= maxv/2;
  cout << sum << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'INT_MIN' was not declared in this scope
   16 |   int maxv = INT_MIN;
      |              ^~~~~~~
a.cc:7:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <algorithm>
  +++ |+#include <climits>
    7 | using namespace std;
Language: C++

#include <iostream>
int main(){
   int N,price;
   int a[N];
   cin >> N;
   for(int i=0; i<N; N++){
      cin >> a[i];
      price += a[i];
   }
   price -= max(a[0],a[N-1])/2
   cout << price << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |    cin >> N;
      |    ^~~
      |    std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:13: error: 'max' was not declared in this scope; did you mean 'std::max'?
   10 |    price -= max(a[0],a[N-1])/2
      |             ^~~
      |             std::max
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <iosream>
int main(){
   int N,price;
   int a[N];
   cin >> N;
   for(int i=0; i<N; N++){
      cin >> a[i];
      price += a[i];
   }
   price -= max(a[0],a[N-1])/2
   cout << price << endl;
}

Compiler output:
a.cc:1:10: fatal error: iosream: No such file or directory
    1 | #include <iosream>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<cstring>
int a[105];
int Fac(int x,int y){
int z;
if(x > y) z = x;
else z = y;
return z；
}

using namespace std;

int main(){
    int N,sum,max = 0;
scanf("%d",&N);
for(int i = 1;i <= N;i++){
scanf("%d",&a[i]);
if(a[i] % 2 != 0) a[i] = a[i] + 1;
sum = sum + a[i];
max = Fac(a[i],max);
}
sum = sum - max/2;
printf("%d\n",sum);

return 0;
}

Compiler output:
a.cc: In function 'int Fac(int, int)':
a.cc:11:8: error: 'z\U0000ff1b' was not declared in this scope
   11 | return z；
      |        ^~~
a.cc:11:11: error: expected ';' before '}' token
   11 | return z；
      |           ^
      |           ;
   12 | }
      | ~
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // System.out.println("input a number: ");
        int d = sc.nextInt();
        float[] price = new float[d];
        int maxIndx = 0;
        for (int i = 0; i < d; i++) {
            price[i] = sc.nextFloat();
            if (price[maxIndx] < price[i]) {
                maxIndx = i;
            }
        }

        float sum = 0;

        for (int i = 0; i < price.length; i++) {
            sum += price[i];
        }

        sum -= price[maxIndx] / 2.0;
        System.out.println(sum);
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	
	int sum = 0;
	int p;
	int m = 0;
	for (int i = 0; i < n; i++) {
		cin >> p;
		sum += p;
		m = max(m, p);
	}
	
	sum -= max / 2;
	
	cout << sum << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
   21 |         sum -= max / 2;
      |                ~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	
	int sum = 0;
	int p;
	int max = 0;
	for (int i = 0; i < n; i++) {
		cin >> p;
		sum += p;
		max = max(max, p);
	}
	
	sum -= max / 2;
	
	cout << sum << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: 'max' cannot be used as a function
   18 |                 max = max(max, p);
      |                       ~~~^~~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> p(N);
  for (int i = 0; i < N; i++) {
    cin >> p[i];
  }
  int Max = *max.element(p.begin(), p.end());
  int sum = accumulate(p.begin(), p.end(), 0);
  int ans = (sum - Max) + (Max / 2);
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: overloaded function with no contextual type information
   11 |   int Max = *max.element(p.begin(), p.end());
      |                  ^~~~~~~
Language: C++

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

int main(){
  int N; cin>>N;
  vector<int> p(N);
  for(int x:p){
    cin>>x;
  }
  sort(p.begin(), p.end());
  int sum=0;
  for(int y:p){
    sum += y;
  }
  sum -= p.at(N-1)/2
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before 'cout'
   15 |   sum -= p.at(N-1)/2
      |                     ^
      |                     ;
   16 |   cout<<sum<<endl;
      |   ~~~~
Language: C++

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

int main(){
  int N; cin>>N;
  vector<int> p(N);
  for(int x:p){
    cin>>x;
  }
  sort(p.begin(), p.end())
  int sum=0;
  for(int y:p){
    sum += y;
  }
  sum -= p.at(N-1)/2
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: expected ';' before 'int'
   10 |   sort(p.begin(), p.end())
      |                           ^
      |                           ;
   11 |   int sum=0;
      |   ~~~                      
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum += y;
      |     ^~~
a.cc:15:3: error: 'sum' was not declared in this scope
   15 |   sum -= p.at(N-1)/2
      |   ^~~
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
int a[12];
int main(){
	int T;
	int i = 0;
	int sum = 0;
	scanf("%d", &T);
	for(int i = 1; i <= T; i++){
		scanf("%d ", &a[i]);	
	}
	sort(a + 1, a + 1 + T,);
	sum = a[T]/2;
	for(int i = 1; i <= T - 1; i++){
		sum += a[i];	
	}
	printf("%d\n", sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: expected primary-expression before ')' token
   15 |         sort(a + 1, a + 1 + T,);
      |                               ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int p[n],sum;
    for(int i = 0; i<n ; i++)
    {
        cin >> p[i];

        if(max < p[i])
        {   sum += max;
            max = p[i];
            continue;
        } 
        sum += p[i];

    }
    max /= 2;
    printf("%d\n",max+sum);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: parse error in template argument list
   14 |         if(max < p[i])
      |            ^~~~~~~~~~
a.cc:14:22: error: cannot resolve overloaded function 'max' based on conversion to type 'bool'
   14 |         if(max < p[i])
      |                      ^
a.cc:15:20: error: overloaded function with no contextual type information
   15 |         {   sum += max;
      |                    ^~~
a.cc:16:22: error: overloaded function with no contextual type information
   16 |             max = p[i];
      |                      ^
a.cc:22:12: error: overloaded function with no contextual type information
   22 |     max /= 2;
      |            ^
a.cc:23:22: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   23 |     printf("%d\n",max+sum);
      |                   ~~~^~~~
Language: C++

#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  v.back() /= 2;
  
  int sum = 0;
  for (int i : v) {
    sum += i;
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> v;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> v;
      |          ^~~
a.cc:12:5: error: 'v' was not declared in this scope
   12 |     v.push_back(a);
      |     ^
a.cc:14:8: error: 'v' was not declared in this scope
   14 |   sort(v.begin(), v.end());
      |        ^
Language: Java

public class Main{
	public static void main(String[] argv){
		int N = in.nextInt();
		int[] goods = new int[N];
		int ans = 0;
		for(int i=0;i<N;i++){
			goods[i] = in.nextInt();
			ans += goods[i];
		}
		Arrays.sort(goods);
		ans -= goods[N-1]/2;
		System.out.println(ans);
	}

}

Compiler output:
Main.java:3: error: cannot find symbol
		int N = in.nextInt();
		        ^
  symbol:   variable in
  location: class Main
Main.java:7: error: cannot find symbol
			goods[i] = in.nextInt();
			           ^
  symbol:   variable in
  location: class Main
Main.java:10: error: cannot find symbol
		Arrays.sort(goods);
		^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C

#include<stdio.h>
int main(void){
  int i,j,k,N,p[10],temp,sum=0;
  scanf("%d",&N);
  for(i=0;i<=N-1;i++){
    printf("\n");
    scanf("%d",&p[i]);
  }
  for(j=0;j<=N-1;j++){
  	if(p[j]>p[j+1]){
    	p[j]=temp;
    	p[j]=p[j+1];
    	p[j+1]=temp;
    }
  }
  p[N-1]=p[N-1]/2;
  for(k=0;k<=N-1;k++){
    sum+=p[k]+;
  }
  printf("%d\n",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:15: error: expected expression before ';' token
   18 |     sum+=p[k]+;
      |               ^
Language: C

#include<stdio.h>
int main(void){
  int i,j,k,N,p[10],temp,sum=0;
  scanf("%d",N);
  for(i=0;i<=N-1;i++){
    scanf("%d",p[i]);
  }
  for(j=0;j<=N-1;j++){
  	if(p[j]>p[j+1]){
    	p[j]=temp;
    	p[j]=p[j+1];
    	p[j+1]=temp;
    }
  }
  p[N-1]=p[N-1]/2;
  for(k=0;k<=N-1;k++){
    sum+=p[k]+;
  }
  printf("%d\n",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:15: error: expected expression before ';' token
   17 |     sum+=p[k]+;
      |               ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main()
{
	int n; cin >> n;
	int p[n]; for (int i = 0; i < n; i++) cin >> p[i];
        int sum = 0;
	
	sort(p, p + n);
	reverse(p, p + n);
	
	sum += (p[0] / 2);
	for (int i = 1; i < n; i++) else sum += p[i];
	
	cout << sum << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: expected primary-expression before 'else'
   15 |         for (int i = 1; i < n; i++) else sum += p[i];
      |                                     ^~~~
Language: C

#include<stdio.h>
int main(void){
  int i,j,k,N,p[10],temp,sum=0;
  scanf("%d",&N);
  for(i=0;i<=N-1;i++){
    scanf("%d",&p[i]);
  }
  for(j=0;j<=N-1;j++){
  	if(p[j]>p[j+1]){
    	p[j]=temp;
    	p[j]=p[j+1];
    	p[j+1]=temp;
    }
  }
  p[N-1]=p[N-1]/2;
  for(k=0;k<=N-1;k++){
    sum+=p[k]+;
  }
  printf("%d\n",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:15: error: expected expression before ';' token
   17 |     sum+=p[k]+;
      |               ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main()
{
	int n; cin >> n;
	int p[n]; for (int i = 0; i < n; i++) cin >> p[i];
        int sum = 0;
	
	sort(p, p + n);
	reverse(p, p + n);
	
	sum += (p[0] / 2)
	for (int i = 1; i < n; i++) else sum += p[i];
	
	cout << sum << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: expected ';' before 'for'
   14 |         sum += (p[0] / 2)
      |                          ^
      |                          ;
   15 |         for (int i = 1; i < n; i++) else sum += p[i];
      |         ~~~               
a.cc:15:25: error: 'i' was not declared in this scope
   15 |         for (int i = 1; i < n; i++) else sum += p[i];
      |                         ^
Language: C

#include<stdio.h>
int main(void){
  int i,j,k,N,p[10],temp,sum=0;
  scanf("%d",&N);
  for(i=0;i<=N-1;i++){
    scanf("%d",&p[i]);
  }
  for(j=0;j<=N-1;j++){
  	if(p[j]>p[j+1]){
    	p[j]=temp;
    	p[j]=p[j+1];
    	p[j+1]=temp;
    }
  }
  p[N-1]=p[N-1]/2;
  for(k=0;k<=N-1;k++){
    sum+=p[k]+
  }
  printf("%d\n",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:3: error: expected expression before '}' token
   18 |   }
      |   ^
Language: C

#include<stdio.h>
int main(void){
  int i,j,,k,N,p[10],temp,sum=0;
  scanf("%d",&N);
  for(i=0;i<=N-1;i++){
    scanf("%d",&p[i]);
  }
  for(j=0;j<=N-1;j++){
  	if(p[j]>p[j+1]){
    	p[j]=temp;
    	p[j]=p[j+1];
    	p[j+1]=temp;
    }
  }
  p[N-1]=p[N-1]/2;
  for(k=0;k<=N-1;k++){
    sum+=p[k]+
  }
  printf("%d\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:11: error: expected identifier or '(' before ',' token
    3 |   int i,j,,k,N,p[10],temp,sum=0;
      |           ^
main.c:4:15: error: 'N' undeclared (first use in this function)
    4 |   scanf("%d",&N);
      |               ^
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:17: error: 'p' undeclared (first use in this function)
    6 |     scanf("%d",&p[i]);
      |                 ^
main.c:10:14: error: 'temp' undeclared (first use in this function)
   10 |         p[j]=temp;
      |              ^~~~
main.c:16:7: error: 'k' undeclared (first use in this function)
   16 |   for(k=0;k<=N-1;k++){
      |       ^
main.c:17:5: error: 'sum' undeclared (first use in this function)
   17 |     sum+=p[k]+
      |     ^~~
main.c:18:3: error: expected expression before '}' token
   18 |   }
      |   ^
Language: C

#include<stdio.h>
#include <stdlib.h>
int main(void){
  
	int a[100000];
	int min;
 	int n, i, b, k, x, tmp, j, count, answer;
 	scanf("%d %d",&n,&k);
 	for (i = 0; i<n; i++){
      scanf("%d", &a[i]);  //ここまで配列の準備
      b =  b + a[i];
 	}
    /* 数値を昇順にソート */
    for (i=0; i<n; ++i) {
       for (j=i+1; j<n; ++j) {
      	  if (a[i] > a[j]) {
              tmp =  a[i];
              a[i] = a[j];
              a[j] = tmp;
          }
       }
     }

    count = 0;
    min = 1000000000;
    j = 0;
    for(i=0; i<n-k; ++i){
    	count = a[i+k-1] - a[i];
        if(abs(count)<=min){
           min = count;
        }if(min==0;){
        	break;
        }
    }
   printf("%d\n",min);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:19: error: expected ')' before ';' token
   31 |         }if(min==0;){
      |            ~      ^
      |                   )
Language: C++

#include <iostream>
usng namespace std;
main(){
	int n;
	cin >> n;
	int p[n];
	int max=0;
	int total=0;
	for(int i=0;i<n;i++){
		cin >> p[i];
		total+=p[i];
		if(p[i]>max)
			max=p[i];
	}total-=max/2;
	cout << total <<endl;
}


Compiler output:
a.cc:2:1: error: 'usng' does not name a type
    2 | usng namespace std;
      | ^~~~
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << total <<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |         cout << total <<endl;
      |                         ^~~~
      |                         std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int a[10], ma, ans;
int main(){
for(int i=0; i<n; ++i){
int t;
cin>>t;
ans +=t;
if(ma < t) ma = t;
}
ans -= ma/2;
cout <<ans<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'n' was not declared in this scope
    5 | for(int i=0; i<n; ++i){
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main(){
int N;
  int p[10000];
  cin >> N;
  for(int i = 0;i<N;i++) cin >> p[i];
  
  sort(p,greater<int>());
  p.at(0) = p/2;
  p++;
  cout << p << 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(p,greater<int>());
      |   ^~~~
      |   short
a.cc:11:5: error: request for member 'at' in 'p', which is of non-class type 'int [10000]'
   11 |   p.at(0) = p/2;
      |     ^~
a.cc:11:14: error: invalid operands of types 'int [10000]' and 'int' to binary 'operator/'
   11 |   p.at(0) = p/2;
      |             ~^~
      |             | |
      |             | int
      |             int [10000]
a.cc:12:3: error: lvalue required as increment operand
   12 |   p++;
      |   ^
Language: C++

#include <iostream>
#include <limits.h>
using namespace std;
int main(){
int D;
cin >> D;
int max = 0;
int sum=0;
for (int i=0;i<N;i++)
{
int p;
cin>>p;
if(p>max)
max=p;
sum+=p;
}
cout << sum - (int)max /2 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'N' was not declared in this scope
    9 | for (int i=0;i<N;i++)
      |                ^
Language: C++

#include <iostream>
#include <limits.h>
int main(){
int D;
cin >> D;
int max = 0;
int sum=0;
for (int i=0;i<N;i++)
{
int p;
cin>>p;
if(p>max)
max=p;
sum+=p;
}
cout << sum - (int)max /2 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin >> D;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:16: error: 'N' was not declared in this scope
    8 | for (int i=0;i<N;i++)
      |                ^
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | cout << sum - (int)max /2 <<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 | cout << sum - (int)max /2 <<endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <stdio.h>

int main(void){
  int n,p,q=0,sum=0;
  	
  	scanf("%d", &n);
  	
  	for(i=0;i<n;i++){
		scanf("%d", &p);
      	sum+=p;
      	if(p>q){
		q=p;
        }
    }
  
  	printf("%d", sum-q/2);
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: 'i' undeclared (first use in this function)
    8 |         for(i=0;i<n;i++){
      |             ^
main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int a[105]
int main(){
	int N;
	scanf("%d",&N);
	for(int i = 1;i <= N;i++){
		scanf("%d",a[i]);
	}
	sort(a[1],a[N]);
	int sum;
	for(int j = 1;j <= N,j++){
		sum = 0 + a[i];
	}
	printf("%d",sum);
	return 0;
}


Compiler output:
a.cc:8:1: error: expected initializer before 'int'
    8 | int main(){
      | ^~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  for (int i = 0 ; i < n; i++) {
    cin >> p[i];
  }
  sort(p.begin(), p.end(), greater<int>());

  int ans = p[0] / 2;
  for (int i = 1; i < p.size(); i++)
    ans += p[i];
  cout << ans << endl;g
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'g' was not declared in this scope
   16 |   cout << ans << endl;g
      |                       ^
Language: C++

#include <stdio.h>
using namespace std;

int main() {
  int n,i,j;
  scanf("%d",&n);
  int p[n];
  for(i = 0;i<n;i++){
    scanf("%d",&p[i]);
  }
  int a;
  for(i = 0;i<n-1;i++){
    for(j = n-1;j > i;j--){
      if(p[j-1] > p[j]){
          a = p[j-1];
          p[j-1] = p[j];
          p[j] =a;
      } 
    }
  }
  a = 0;
  for(i = 0;i < n-1){
    a +=p[i];
  }
  a +=(p[n-1]/2);
  printf("%d",a);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: expected ';' before ')' token
   22 |   for(i = 0;i < n-1){
      |                    ^
      |                    ;
Language: C

#include <stdio.h>

int main()
{
    int n;
    max = 0;
    scanf("%d",&n);
    int *price = (int *)malloc(n);
    sum = 0; 
    for(int j=0;j<n;j++){
        scanf("%d",price+j);
        if(*(price+j)>max) {
            sum += max;
            max = *(price+j);
        }
        else sum+= *(price+j);
    }
    sum += max/2;
    printf("%d",sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: 'max' undeclared (first use in this function)
    6 |     max = 0;
      |     ^~~
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:25: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |     int *price = (int *)malloc(n);
      |                         ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:25: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |     int *price = (int *)malloc(n);
      |                         ^~~~~~
main.c:8:25: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:9:5: error: 'sum' undeclared (first use in this function)
    9 |     sum = 0;
      |     ^~~
Language: Java

import java.util.*;
public class main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n;
		int []p= {};
		int max=0;
		int sum=0;
		int ans=0;
		
		n=sc.nextInt();
		
		for(int i=0;i<=n;i++) {
			p[i]=sc.nextInt();
			
			if(max<p[i]) {
				max=p[i];
			}
			sum+=p[i];
		}
		ans=sum-max+(max/2);
		System.out.println(ans);
	}
}


Compiler output:
Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C

#include<stdio.h>{
	int main(){
		int p[n];
		int i,x=0;
		int max=0;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d",p[i])
			if(p[i]>max){
				max=p[i];
			}
		}
		
		for(i=0;i<n;i++){
			if(p[i]=max){
				x+=p[i]/2;
			}
			else{
				x+=p[i];
			}
		}
	return(0);
}

Compiler output:
main.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>{
      |                  ^
main.c: In function 'main':
main.c:3:23: error: 'n' undeclared (first use in this function)
    3 |                 int p[n];
      |                       ^
main.c:3:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:41: error: expected ';' before 'if'
    8 |                         scanf("%d",p[i])
      |                                         ^
      |                                         ;
    9 |                         if(p[i]>max){
      |                         ~~
Language: C++

#include<iostream>
using namespace std;

int main() {
    int N;
    cin >> N;
    int max = 0;
    int sum = 0;
    int tmp;
    for (int i=0; i<N; i++) {
        cin >> tmp
        sum += tmp;
        if (tmp > max) {
            max = tmp;
        }
    }
    cout << sum-tmp/2 << endl;
    return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before 'sum'
   11 |         cin >> tmp
      |                   ^
      |                   ;
   12 |         sum += tmp;
      |         ~~~        
a.cc:18:13: error: expected ';' before '}' token
   18 |     return 0
      |             ^
      |             ;
   19 | }
      | ~
Language: C

#include "stdio.h"

int main(void){
  int N;
  if(scanf("%d", &N)==EOF)
    return 0;
  int a[n];
  int max, sum;
  for(int i=0; i <N; i++){
  	if(scanf("%d", &a[i])==EOF) return 0;
    if(a[i] >= max)
      max = a[i];
  }
  int flag =1;
  for(int i=0; i < N; i++){
    if(a[i]==max && flag ==1){
      sum += a[i] / 2;
      flag = 0;
    }
    else
      sum += a[i];
  }
  

}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: 'n' undeclared (first use in this function)
    7 |   int a[n];
      |         ^
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
2.#include<algorithm>
3.using namespace std;
4.int main()
5.{
6.	int a,d[a]={},i,v,z=0;
7.	cin>>a;
8.	cin>>d[a];
9.	for(i=1;i<=a;i++){
10.		v=z+d[i];
11.	}
12.	int N;
13.	N=max({d[a]});
14.	int ans;
15.	ans=v-N/2;
16.	cout<<ans<<endl;
17.}


Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | 2.#include<algorithm>
      |   ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.#include<algorithm>
      | ^~
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4.int main()
      | ^~~~~
Language: C

#include<stdio.h>
 
int main(void){
	int N=0,max=0,sum=0;
  	scanf("%d",&N);
	int p[N]={0};
  for(int i=0;i<N;i++){
  	scanf("%d",&p[i]);
    if(max<p[i]) {
    	max=p[i];
    }
    sum+=p[i];
  }
  sum-=max/2;
  printf("%d",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:18: error: variable-sized object may not be initialized except with an empty initializer
    6 |         int p[N]={0};
      |                  ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int N = sc.nextInt();
        for (int i=0; i<=N; i++) {
            int di = sc.nextInt();
        }
        best=0;
        sum=0;
        for (int i=0; i<=N; i++) {
            if(best>di){
                best=di
            }
            sum=sum+di
        }
        sum=best-(best)/2
        System.out.println(sum);
	}
}

Compiler output:
Main.java:14: error: ';' expected
                best=di
                       ^
Main.java:16: error: ';' expected
            sum=sum+di
                      ^
Main.java:18: error: ';' expected
        sum=best-(best)/2
                         ^
3 errors
Language: C

#include<stdio.h>
 
int main(void){
	int N,max,sum=0;
  	scanf("%d",&N);
	int p[N];
  for(int i=0;i<N;i++){
  	scanf("%d",&p[i]);
    if(max<p[i]) {
    	max=p[i];
    }
    sum+=p[i];
  }
  sum-=max/2
  printf("%d",sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:13: error: expected ';' before 'printf'
   14 |   sum-=max/2
      |             ^
      |             ;
   15 |   printf("%d",sum);
      |   ~~~~~~
Language: C++

#include <iostream>
#include <algorithm>

int main(){
  int N;
  std::cin >> N;
  int sum = 0;
  int max = 0;
  for(int i = 0;i<N;++i){
    int p;
    std::cin >> p;
    sum += p;
    max = std::max(max, p);
  }
  std::cout << sum-p/2 << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: 'p' was not declared in this scope
   15 |   std::cout << sum-p/2 << std::endl;
      |                    ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int max = 0;
		int total = 0;
		while (sc,hasNext()) {
			int a = sc.nextInt();
			if (a > max) max = a;
			total += a;
		}
		// 出力
		System.out.println(total - max/2);
	}
}


Compiler output:
Main.java:7: error: ')' expected
		while (sc,hasNext()) {
		         ^
Main.java:7: error: ';' expected
		while (sc,hasNext()) {
		                   ^
2 errors
Language: C++

#include <iostream>
using namespece std;

int main()
{
  int n, p, sum, max;
	cin >> n;

	cin >> max;
	sum = max;

	for (int i = 1; i < n; ++i)
	{
		cin >> p;
		sum += p;
		max = (p > max) ? p : max;
	}

	sum -= max / 2;

	cout << sum;
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespece'
    2 | using namespece std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |         cout << sum;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
    int N, p[10], pmax = 0, ans = 0;
    cin >> N;
    for(int i = 0; i < N; ++i){
        cin >> p[i];
        if(p[i] > pmax)pmax = i;
    }
    for(int i = 0; i < N; ++i){
        if(i == pmax)p[i] = p[i] / 2;
        ans += p[i]
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before '}' token
   12 |         ans += p[i]
      |                    ^
      |                    ;
   13 |     }
      |     ~