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

def permutation(n,r)
	result=1
	for i in 0..r-1 do
		result*=n-i
	end
	return result
end

def factorial(x)
	result=1
	for i in 1..x do
		result*=i
	end
	return result
end

def solve(n,m,r)
	if n+r-n*m-1<n-1||n+r-n*m-1<0||n-1<0 then
		return 0
	end
	return permutation(n+r-n*m-1,n-1)/factorial(n-1)
end

n,m,r=gets.split(/\s/).map{|x|x.to_i}
puts solve(n,m,r)

Compiler output:
a.cc:3:18: error: too many decimal points in number
    3 |         for i in 0..r-1 do
      |                  ^~~~
a.cc:11:18: error: too many decimal points in number
   11 |         for i in 1..x do
      |                  ^~~~
a.cc:24:19: error: stray '\' in program
   24 | n,m,r=gets.split(/\s/).map{|x|x.to_i}
      |                   ^
a.cc:1:1: error: 'def' does not name a type
    1 | def permutation(n,r)
      | ^~~
a.cc:25:1: error: 'puts' does not name a type
   25 | puts solve(n,m,r)
      | ^~~~
Language: C++

def fact(n):
    res = 1
    for i in range(1, n+1):
        res *= i
    return res

def combination(n, k):
    return fact(n)//fact(n-k)//fact(k)

n, m, r = list(map(int, input().split()))

print(combination(r - n*m + n - 1, n-1))

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def fact(n):
      | ^~~
Language: C++

import std.bigint;
import std.stdio;
import core.stdc.stdio;
 
void main() {
	int n,m,r;
	scanf("%d%d%d",&n,&m,&r);
	r -= n*m;
	
	if(r<=0) puts("0");
	else{
		BigInt ans = 1;
		for(int i=1; i<n; i++){
			ans = ans * (i+r) / i;
		}
		writeln(ans);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.bigint;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import std.stdio;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import core.stdc.stdio;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%d%d%d",&n,&m,&r);
      |         ^~~~~
a.cc:10:18: error: 'puts' was not declared in this scope
   10 |         if(r<=0) puts("0");
      |                  ^~~~
a.cc:12:17: error: 'BigInt' was not declared in this scope
   12 |                 BigInt ans = 1;
      |                 ^~~~~~
a.cc:14:25: error: 'ans' was not declared in this scope
   14 |                         ans = ans * (i+r) / i;
      |                         ^~~
a.cc:16:25: error: 'ans' was not declared in this scope
   16 |                 writeln(ans);
      |                         ^~~
a.cc:16:17: error: 'writeln' was not declared in this scope
   16 |                 writeln(ans);
      |                 ^~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip	;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1<<30;
class Calc{
	#define N 10000
	#define MOD 100000000
    public:
    int carry, borrow,w,remainder;
	int z[N];
	void Calc::ladd(int a[], int b[]){
		carry=0;
		for(int i=N-1;i>=0;i--){
			z[i]=a[i]+b[i]+carry;
			if(z[i]<MOD)carry=0;
			else{
				z[i]-=MOD;
				carry=1;
			}
		}
	}
	void Calc::lsub(int a[], int b[]){
		borrow=0;
		for(int i=N-1;i>=0;i--){
			z[i]=a[i]-b[i]-borrow;
			if(z[i]>=0)borrow=0;
			else{
				z[i]+=MOD;
				borrow=1;
			}
		}
	}
	void Calc::lmul(int c[], int d){
		carry=0;
		for(int i=N-1;i>=0;i--){
			w=c[i];
			z[i]=(w*d+carry)%MOD;
			carry=(w*d+carry)/MOD;
		}
	}
	void Calc::ldiv(int c[], int d){
		remainder=0;
		for(int i=0;i<N;i++){
			w=c[i];
			z[i]=(w+remainder)/d;
			remainder=((w+remainder)%d)*MOD;
		}
	}
	void Calc::displayL(int s[]){
		int t=0;
		for(;t<N;t++)if(s[t]){
			printf("%d",s[t]);
			break;
		}
		for(t++;t<N;t++)printf("%08d",s[t]);
		printf("\n");
	}
	void Calc::displayS(int s){
		for(int i=0;i<N-1;i++)printf("%8s"," ");
		printf("%08d\n",s);
	}
};
int main(){
	Calc calc;
	ll a,b,c;
	cin>>a>>b>>c;
	c-=a*b;
	if(c<0){
		cout<<0<<endl;
	}else{
		rep(i,N){
			calc.z[i]=0;
		}
		calc.z[N-1]=1;
		loop(i,1,c+a)calc.lmul(calc.z,i);
		loop(i,1,c+1)calc.ldiv(calc.z,i);
		loop(i,1,a)calc.ldiv(calc.z,i);
		calc.displayL(calc.z);
	}
}

Compiler output:
a.cc:39:14: error: extra qualification 'Calc::' on member 'ladd' [-fpermissive]
   39 |         void Calc::ladd(int a[], int b[]){
      |              ^~~~
a.cc:50:14: error: extra qualification 'Calc::' on member 'lsub' [-fpermissive]
   50 |         void Calc::lsub(int a[], int b[]){
      |              ^~~~
a.cc:61:14: error: extra qualification 'Calc::' on member 'lmul' [-fpermissive]
   61 |         void Calc::lmul(int c[], int d){
      |              ^~~~
a.cc:69:14: error: extra qualification 'Calc::' on member 'ldiv' [-fpermissive]
   69 |         void Calc::ldiv(int c[], int d){
      |              ^~~~
a.cc:77:14: error: extra qualification 'Calc::' on member 'displayL' [-fpermissive]
   77 |         void Calc::displayL(int s[]){
      |              ^~~~
a.cc:86:14: error: extra qualification 'Calc::' on member 'displayS' [-fpermissive]
   86 |         void Calc::displayS(int s){
      |              ^~~~
Language: C++

#include <cstdio>
#include <cstring>

#define BASE (1000000)
typedef long long lint;

int main()
{
    int n, m, r;
    int head, tail;
    int i, j;
    static lint ans[20000], temp[20000];
    lint carry;
    
    tail = sizeof(ans) / sizeof(__int64) - 1;
    
    scanf("%d%d%d", &n, &m, &r);
    
    if (r - m * n < 0 || n + r - m * n - 1 < 0){
        printf("0\n");
    }
    else {
        head = tail;
        ans[tail] = 1;
        
        //nCkを求める. n!
        for (i = 1; i <= n + r - m * n - 1; i++){
            carry = 0;
            for (j = tail; j >= head; j--){
                carry += i * ans[j];
                ans[j] = carry % BASE;
                carry /= BASE;
            }
            while (carry != 0){
                ans[--head] = carry % BASE;
                carry /= BASE;
            }
        }
        
        
        //k!
        for (i = r - m * n; i >= 2; i--){
            memcpy(temp, ans, sizeof(ans));
            carry = 0;
            for (j = head; j <= tail; j++){
                carry = carry * BASE + temp[j];
                ans[j] = carry / i;
                carry %= i;
            }
        }
        
        //(n - k)!
        for (i = n - 1; i >= 2; i--){
            memcpy(temp, ans, sizeof(ans));
            carry = 0;
            for (j = head; j <= tail; j++){
                carry = carry * BASE + temp[j];
                ans[j] = carry / i;
                carry %= i;
            }
        }
        
        while (ans[head] == 0){
            head++;
        }
        
        
        for (i = head; i <= tail; i++){
            if (i != head){
                printf("%06lld", ans[i]);
            }
            else {
                printf("%lld", ans[i]);
            }
        }
        printf("\n");
    }
    
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   15 |     tail = sizeof(ans) / sizeof(__int64) - 1;
      |                                 ^~~~~~~
      |                                 __int64_t
Language: C++

// -*- coding:utf-8; tab-width:4 -*-
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>

// ティツァツ」テァツュツ?
namespace solution {
    using namespace std;
   
    typedef istringstream ISS;
    typedef ostringstream OSS;
    typedef vector<string> VS;
    typedef long long LL;
    typedef int INT;
    typedef vector<INT> VI;
    typedef vector<VI> VVI;
    typedef pair<INT, INT> II;

    struct Solution {
        void init() {
        }
   
        bool input() {
        }

        solve() {
        }
      
        int run() {
            while ( init(), input() ) {
                solve();
            }
            return 0;
        }
    };
}

int main() {
    return solution::Solution().run();
}

Compiler output:
a.cc:42:9: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
   42 |         solve() {
      |         ^~~~~
a.cc: In member function 'bool solution::Solution::input()':
a.cc:40:9: warning: no return statement in function returning non-void [-Wreturn-type]
   40 |         }
      |         ^
a.cc: In member function 'int solution::Solution::solve()':
a.cc:43:9: warning: no return statement in function returning non-void [-Wreturn-type]
   43 |         }
      |         ^
Language: C++

import math
import sys
n, m, r=sys.stdin.readline().split()
n=int(n)
m=int(m)
r=int(r)

if r-n*m >= 0:
    print math.factorial(r-n*m+n-1)/math.factorial(r-n*m)/math.factorial(n-1)
else :
    print 0

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++


def foo(infile, outfile):
    import math
    n, m, r=infile.readline().split()
    n=int(n)
    m=int(m)
    r=int(r)
    print 0
    if r-n*m >= 0:
        print math.factorial(r-n*m+n-1)/math.factorial(r-n*m)/math.factorial(n-1)
    else :
        print 0

if __name__ == "__main__":
    import sys
    foo(sys.stdin, sys.stdout)

Compiler output:
a.cc:2:1: error: 'def' does not name a type
    2 | def foo(infile, outfile):
      | ^~~
Language: C++

#include <iostream>
using namespace std;


int N, M, R;
int memo[10000][10000];

int rec(int i, int rest)
{
	if(memo[i][rest] == -1) return memo[i][rest];
	
	if(i == N) return rest == 0;
	
	int ret = 0;
	for(int use = 0; use <= rest; use++) {
		ret += rec(i+1, rest - use);
	}

	return memo[i][rest] = ret;
}

int main()
{
	memset(memo, -1, sizeof memo);
	cin >> N >> M >> R;
	cout << rec(0, R - N*M) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(memo, -1, sizeof memo);
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

def kaijou(n):
	res=1
	for i in xrange(1,x+1):
		res*=i
	return res

def comb(a,b):
	if(a<b or b<0):return 0
	if(b==0):return 1
	return kaijou(a)/kaijou(b)/kaijou(a-b)

a,b,c=map(int,raw_input().split())
c-=a*b
print comb(c+a-1,c)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def kaijou(n):
      | ^~~
Language: Java

import java.util.Scanner;
public class AverageScore {
	public static void main(String[] args) {
		final Scanner sc= new Scanner(System.in);
		int sum=0;
		for(int i=0;i<5;i++){
			int num=sc.nextInt();
			if(num<40) sum+=40;
			else sum+=num;
		}
		
		System.out.println(sum/5);
	}
}

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

import java.util.Scanner;

public class aoj {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		for(int i=0;i<5;i++){
			int a = sc.nextInt();
			if(a<40){
				a = 40;
			}
			sum += a;
		}
	    System.out.println(sum/5);
	}

}

Compiler output:
Main.java:3: error: class aoj is public, should be declared in a file named aoj.java
public class aoj {
       ^
1 error
Language: Java

package SD;
import java.util.Scanner;
public class Z01 {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int[10];
		int ave,sum = 0;

		for(int i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
			sum = sum+score[i];
		}

		ave = sum/5;
		sc.close();

		System.out.println(ave);

	}

}

Compiler output:
Main.java:3: error: class Z01 is public, should be declared in a file named Z01.java
public class Z01 {
       ^
1 error
Language: Java

import java.util.Scanner;
public class Z01 {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int[10];
		int ave,sum = 0;

		for(int i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
			sum = sum+score[i];
		}

		ave = sum/5;
		sc.close();

		System.out.println(ave);

	}

}

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

package AOJ0414;
import java.util.Scanner;
public class averagescore1 {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

}

Compiler output:
Main.java:3: error: class averagescore1 is public, should be declared in a file named averagescore1.java
public class averagescore1 {
       ^
1 error
Language: Java


	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

}

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



import java.io.InputStreamReader;
import java.util.Scanner;

public class MAIN {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????


InputStreamReader isr = new InputStreamReader(System.in);
	int ave,sum=0;
	Scanner sc = new Scanner(System.in);
	int[] data=new int[10];
	for(int i=0;i<5;i++){
		 data[i]=sc.nextInt();
		if(data[i]<40)data[i]=40;
	}
	for(int i=0;i<5;i++){
		sum+=data[i];
	}


	System.out.printf("%d\n", sum/5);



	}

}

Compiler output:
Main.java:6: error: class MAIN is public, should be declared in a file named MAIN.java
public class MAIN {
       ^
1 error
Language: Java

package Class01;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int sum = 0;
		for(int i = 0; i < 5; i++){
			a[i] = sc.nextInt();
			if(a[i] < 40){
				a[i] = 40;
			}
		}
		for(int i = 0; i < 5; i++){
			sum =  sum + a[i];
		}
		
		
		System.out.println(sum/5);
	}

}

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

#include <stdio.h>

int main(void){
	
	int a[5] = {0};
	int i;
	int avg=0;
	
	for(i=0; i<5; i++) {
		scanf("%d", &a[i]);
		if(a[i]<40) a[i]=40;
		avg += a[i];
	}
	
	print("%d", avg/5);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   15 |         print("%d", avg/5);
      |         ^~~~~
      |         printf
Language: C

#include <stdio.h>

int main(void)
{
	int sum = 0;
	int i;
	
	for (i = 0; i < 5; i++){
		int point;
		
		scanf("%d", &point);
		if (point < 40) point = 40;
		sum += point;
	}
	printf("%d\n", point / 5);
}

Compiler output:
main.c: In function 'main':
main.c:15:24: error: 'point' undeclared (first use in this function); did you mean 'printf'?
   15 |         printf("%d\n", point / 5);
      |                        ^~~~~
      |                        printf
main.c:15:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio>
int main(void)
{int x,sum;
  for(i=0; i<5; i++){
  scanf("%d",&x);
  if(x<40)
    x=40;
  sum=sum+x;
  }

  sum=sum/5;

  printf("%d",sum);

  return(0);

}

Compiler output:
main.c:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main(void)
{int x,sum;
  for(i=0; i<5; i++){
  scanf("%d",&x);
  if(x<40)
    x=40;
  sum=sum+x;
  }

  sum=sum/5;

  printf("%d",sum);

  return(0);

}

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

#include<stdio.h>
int main(void)
{int x,sum,i;
  for(i=0; i<5; i++){
  scanf("%d",&x);
  if(x<=40)
    x=40;
  sum=sum+x;
  }

  sum=sum/5;

  printf("%d"\n,sum);

  return(0);

}

Compiler output:
main.c: In function 'main':
main.c:13:14: error: stray '\' in program
   13 |   printf("%d"\n,sum);
      |              ^
main.c:13:14: error: expected ')' before 'n'
   13 |   printf("%d"\n,sum);
      |         ~    ^~
      |              )
Language: C

#include<stdio.h>

int main()
{
	int taro;
	int jiro;
	int sabu;
	int shiro;
	int hanako;
	int sum=0;
	
	scanf("%d",&taro);
	scanf("%d",&jiro);
	scanf("%d",&sabu);
	scanf("%d",&shiro);
	scanf("%d",&hanako);
	
	if(taro<40)sum+=40;
	else sum+=taro;
	if(jiro<40)sum+=40;
	else sum+=jiro;
	if(sabo<40)sum+=40;
	else sum+=sabu;
	if(shiro<40)sum+=40;
	else sum+=shiro;
	if(hanako<40)sum+=40;
	else sum+=hanako;
	
	printf("%d\n",sum/5);	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:12: error: 'sabo' undeclared (first use in this function); did you mean 'sabu'?
   22 |         if(sabo<40)sum+=40;
      |            ^~~~
      |            sabu
main.c:22:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

5.times{n=gets.to_i;s=s+n>40?n:40}p s/5

Compiler output:
main.c:1:1: error: invalid suffix "times" on floating constant
    1 | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5
      | ^~~~~~~
main.c:1:1: error: expected identifier or '(' before numeric constant
main.c:1:35: error: unknown type name 'p'
    1 | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5
      |                                   ^
main.c:1:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token
    1 | 5.times{n=gets.to_i;s=s+n>40?n:40}p s/5
      |                                      ^
Language: C

#include <stdio.h>
int main(void)
{
  int scr[5];
  int sum=0;
  int i;

  for(i=0;i<5;i++);
  scanf("%d",&scr[i]);

  for(i=0;i<5;i++)
    if(v[i]<40)
      v[i]=40;

  for(i=0;i<5;i++)
    sum+=v[i];

  printf("%d\n",sum/5);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:8: error: 'v' undeclared (first use in this function)
   12 |     if(v[i]<40)
      |        ^
main.c:12:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void) {
		int a,b,c,d,e;
	
	scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
	a=(a+b+c+d+e)/5;
	printf("%d\n",a[int]);
	// your code goes here
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:25: error: expected expression before 'int'
    8 |         printf("%d\n",a[int]);
      |                         ^~~
Language: C

#include <stdio.h>

int main(void) {
		int a,b,c,d,e;
	
	scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
	a=(a+b+c+d+e)/5;
	int a;
	printf("%d\n",a);
	// your code goes here
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: redeclaration of 'a' with no linkage
    8 |         int a;
      |             ^
main.c:4:21: note: previous declaration of 'a' with type 'int'
    4 |                 int a,b,c,d,e;
      |                     ^
Language: C

#include <stdio.h>

int main(void) {
		int a,b,c,d,e;
	
	scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
	if(a<40){
		a=40;
	}
	else(b<40){
		b=40;
	}
	else(c<40){
		c=40;
	}
	else(d<40){
		d=40;
	}
	else(e<40){
		e=40;
	}
	a=(a+b+c+d+e)/5;
	int a;
	printf("%d\n",a);
	// your code goes here
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:19: error: expected ';' before '{' token
   10 |         else(b<40){
      |                   ^
      |                   ;
main.c:23:13: error: redeclaration of 'a' with no linkage
   23 |         int a;
      |             ^
main.c:4:21: note: previous declaration of 'a' with type 'int'
    4 |                 int a,b,c,d,e;
      |                     ^
Language: C

#include <stdio.h>

int main(void) {
		int a,b,c,d,e;
	
	scanf("%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e);
	if(a<40){
		a=40;
	}
	else if(b<40){
		b=40;
	}
	else if(c<40){
		c=40;
	}
	else if(d<40){
		d=40;
	}
	else if(e<40){
		e=40;
	}
	a=(a+b+c+d+e)/5;
	int a;
	printf("%d\n",a);
	// your code goes here
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:13: error: redeclaration of 'a' with no linkage
   23 |         int a;
      |             ^
main.c:4:21: note: previous declaration of 'a' with type 'int'
    4 |                 int a,b,c,d,e;
      |                     ^
Language: C

#include<stdio.h>

int main(void)
{
	int n[5];
	int i;
	int avr = 0;
	for(i = 0;i < 5;i++)
	{
		scanf("%d".&n[i]);
	}
	for(i = 0;i < 5;i++)
	{
		if(n[i] < 40)
		{
			n[i] = 40;
		}
	}
	for(i = 0;i < 5;i++)
	{
		avr += n[i];
	}
	avr = avr / 5;
	printf("%d".avr);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:28: error: expected identifier before '&' token
   10 |                 scanf("%d".&n[i]);
      |                            ^
main.c:24:20: error: request for member 'avr' in something not a structure or union
   24 |         printf("%d".avr);
      |                    ^
Language: C

#include <stdio.h>

int fun1(int data[], int n);

int main()
{
	int const n = 5;
	int i,data[n];
	for(i=0; i<n; i++)
	{
		scanf("%d",&data[i]);
		if(data[i]<40)
		{
			data[i]=40;
		}
	}
	
	printf("%d",fun1(data,n));
	return 0;
}

int fun2(int data[], int n)
{
	int i,average = 0;
	
	for(i=0; i<n; i++)
	{
		average += data[i];
	}
	
	return average/n;
}

Compiler output:
/usr/bin/ld: /tmp/cc4VZMEU.o: in function `main':
main.c:(.text+0xd3): undefined reference to `fun1'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
int main(void) {
	int a
	scanf("%d",&a);
	int b;
	scanf("%d",&b);
	int c;
	scanf("%d",&c);
	int d;
	scanf("%d",&d);
	int e;
	scanf("%d",&e);
	int s;
	s= a+b+c+d+e;
	printf("%d\n",s/5);	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    4 |         scanf("%d",&a);
      |         ^~~~~
main.c:4:21: error: 'a' undeclared (first use in this function)
    4 |         scanf("%d",&a);
      |                     ^
main.c:4:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main() {
  int T, J, S, Y, H;
  cin >> T >> J >> S >> y >> H;

  if(T<40){
  T = 40;
  }
  if(J<40){
  J = 40;
  }
  if(S<40){
  S = 40;
  }
  if(Y<40){
  Y = 40;
  }
  if(H<40){
  H = 40;
  }

 cout << (I + J + S + Y + H)/5 << endl;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: 'y' was not declared in this scope
    6 |   cin >> T >> J >> S >> y >> H;
      |                         ^
a.cc:24:11: error: 'I' was not declared in this scope
   24 |  cout << (I + J + S + Y + H)/5 << endl;
      |           ^
Language: C++

i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}

Compiler output:
a.cc:1:1: error: 'i' does not name a type
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      | ^
a.cc:1:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |       ^~~~
a.cc: In function 'int main()':
a.cc:1:31: error: 'a' was not declared in this scope
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |                               ^
a.cc:1:19: error: 'scanf' was not declared in this scope
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |                   ^~~~~
a.cc:1:48: error: 's' was not declared in this scope
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |                                                ^
a.cc:1:53: error: 'i' was not declared in this scope
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |                                                     ^
a.cc:1:77: error: 's' was not declared in this scope
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |                                                                             ^
a.cc:1:63: error: 'printf' was not declared in this scope
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
      |                                                               ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | i,a,s;main(){for(;scanf("%d",&a),a=(a>40)?a:40,s+=a,i<4;i++){}printf("%d\n",s/5);}
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a[5],sum=0;

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

  cout << sum/5 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: lvalue required as increment operand
    7 |   for(int i=0;i<5++i){
      |                 ^
a.cc:7:20: error: expected ';' before 'i'
    7 |   for(int i=0;i<5++i){
      |                    ^
      |                    ;
Language: C++

#include<stdio.h>

int main(){
int s=0,x;
for(inti=0;i<5;i++)
{scanf("%d",&x);if(x<40)x=40;s+=x;}

printf("%d\n",x/5);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'inti' was not declared in this scope; did you mean 'int'?
    5 | for(inti=0;i<5;i++)
      |     ^~~~
      |     int
a.cc:5:12: error: 'i' was not declared in this scope
    5 | for(inti=0;i<5;i++)
      |            ^
Language: C++

#include<iostream>

int main{
  int a[5];
  int b;
  for(int i; i<5; i++){
    cin>>a[i];
    b=b+a[i];
      }
  cout<<b/5<<endl;
}
  
  

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int a[5];
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:3: error: expected unqualified-id before 'for'
    6 |   for(int i; i<5; i++){
      |   ^~~
a.cc:6:14: error: 'i' does not name a type
    6 |   for(int i; i<5; i++){
      |              ^
a.cc:6:19: error: 'i' does not name a type
    6 |   for(int i; i<5; i++){
      |                   ^
a.cc:10:3: error: 'cout' does not name a type
   10 |   cout<<b/5<<endl;
      |   ^~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>
using namespace std; 
int main{
  int a[5];
  int b;
  for(int i; i<5; i++){
    cin>>a[i];
    b=b+a[i];
      }
  cout<<b/5<<endl;
}
  
  

  
  

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int a[5];
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:6:3: error: expected unqualified-id before 'for'
    6 |   for(int i; i<5; i++){
      |   ^~~
a.cc:6:14: error: 'i' does not name a type
    6 |   for(int i; i<5; i++){
      |              ^
a.cc:6:19: error: 'i' does not name a type
    6 |   for(int i; i<5; i++){
      |                   ^
a.cc:10:3: error: 'cout' does not name a type
   10 |   cout<<b/5<<endl;
      |   ^~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>
using namespace std; 

int main(){
  int a[5];
  int b=0;
  for(int i; i<5; i++){
    cin>>a[i];
    a[i]=a[i]/5
      if(a[i]<8){
      a[i]=8}
    b=b+a[i];
    
      }
  cout<<b<<endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before 'if'
    9 |     a[i]=a[i]/5
      |                ^
      |                ;
   10 |       if(a[i]<8){
      |       ~~
Language: C++

#include<iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <set>
#include <string.h>
#include <functional>

using namespace std;


int main()
{
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    if(a<40)
        a=40;
    if(b<40)
        b=40;
    if(c<40)
        c=40;
    if(d<40)
        d=40;
    if(e<40)
        e=40;
    cout<<(s+b+c+d+e)/5<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: 's' was not declared in this scope
   30 |     cout<<(s+b+c+d+e)/5<<endl;
      |            ^
Language: C++

#include<stdio.h>

int main(){
 int data[10], i, sum, ave;
 for(i = 1, i <= 5, i++){
  scanf("%d", &data[i]);
 if(data[i] < 40) data[i] = 40;
 sum += data[i];
 }
 ave = sum / 5;
 printf("%d", ave);
 return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before ')' token
    5 |  for(i = 1, i <= 5, i++){
      |                        ^
      |                        ;
a.cc:11:19: error: expected ')' before ';' token
   11 |  printf("%d", ave);
      |                   ^
      |                   )
a.cc:5:5: note: to match this '('
    5 |  for(i = 1, i <= 5, i++){
      |     ^
Language: C++

#include<stdio.h>

int main(){
 int data[10], i, sum = 0, ave;
 for(i = 1, i <= 5, i++){
  scanf("%d", &data[i]);
 if(data[i] < 40) data[i] = 40;
 sum += data[i];
 }
 ave = sum / 5;
 printf("%d", ave);
 return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before ')' token
    5 |  for(i = 1, i <= 5, i++){
      |                        ^
      |                        ;
a.cc:11:19: error: expected ')' before ';' token
   11 |  printf("%d", ave);
      |                   ^
      |                   )
a.cc:5:5: note: to match this '('
    5 |  for(i = 1, i <= 5, i++){
      |     ^
Language: C++

 JOI13-quest1.cpp  Defines the entry point for the console application.


#include <stdio.h>


int main(void)
{
	int temp, sum = 0;
	for (int i = 0; i  5; i++) {
		scanf(%d, &temp);

		if (temp = 40) {
			sum += temp;
		}
		else {
			sum += 40;
		}
	}

	printf(%dn, sum  5);

	return 0;
}

Compiler output:
a.cc:1:2: error: 'JOI13' does not name a type
    1 |  JOI13-quest1.cpp  Defines the entry point for the console application.
      |  ^~~~~
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before numeric constant
   10 |         for (int i = 0; i  5; i++) {
      |                          ^ ~
      |                          ;
a.cc:10:29: error: expected ')' before ';' token
   10 |         for (int i = 0; i  5; i++) {
      |             ~               ^
      |                             )
a.cc:10:31: error: 'i' was not declared in this scope
   10 |         for (int i = 0; i  5; i++) {
      |                               ^
a.cc:21:16: error: expected primary-expression before '%' token
   21 |         printf(%dn, sum  5);
      |                ^
a.cc:21:17: error: 'dn' was not declared in this scope
   21 |         printf(%dn, sum  5);
      |                 ^~
a.cc:21:24: error: expected ')' before numeric constant
   21 |         printf(%dn, sum  5);
      |               ~        ^ ~
      |                        )
a.cc:21:9: error: 'printf' was not declared in this scope
   21 |         printf(%dn, sum  5);
      |         ^~~~~~
a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    4 | #include <stdio.h>
  +++ |+#include <cstdio>
    5 |
Language: C++

 JOI13-quest1.cpp  Defines the entry point for the console application.

#include <stdio.h>

int main(void)
{
	int temp, sum = 0;
	for (int i = 0; i  5; i++) {
		scanf("%d", &temp);

		if (temp = 40) {
			sum += temp;
		}
		else {
			sum += 40;
		}
	}

	printf("%d\n" sum / 5);

	return 0;
}

Compiler output:
a.cc:1:2: error: 'JOI13' does not name a type
    1 |  JOI13-quest1.cpp  Defines the entry point for the console application.
      |  ^~~~~
a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before numeric constant
    8 |         for (int i = 0; i  5; i++) {
      |                          ^ ~
      |                          ;
a.cc:8:29: error: expected ')' before ';' token
    8 |         for (int i = 0; i  5; i++) {
      |             ~               ^
      |                             )
a.cc:8:31: error: 'i' was not declared in this scope
    8 |         for (int i = 0; i  5; i++) {
      |                               ^
a.cc:19:22: error: expected ')' before 'sum'
   19 |         printf("%d\n" sum / 5);
      |               ~      ^~~~
      |                      )
a.cc:19:9: error: 'printf' was not declared in this scope
   19 |         printf("%d\n" sum / 5);
      |         ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <stdio.h>
  +++ |+#include <cstdio>
    4 |
Language: C++

 //JOI13-quest1.cpp  Defines the entry point for the console application.

#include <stdio.h>

int main(void)
{
	int temp, sum = 0;
	for (int i = 0; i  5; i++) {
		scanf("%d", &temp);

		if (temp = 40) {
			sum += temp;
		}
		else {
			sum += 40;
		}
	}

	printf("%d\n" sum / 5);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected ';' before numeric constant
    8 |         for (int i = 0; i  5; i++) {
      |                          ^ ~
      |                          ;
a.cc:8:29: error: expected ')' before ';' token
    8 |         for (int i = 0; i  5; i++) {
      |             ~               ^
      |                             )
a.cc:8:31: error: 'i' was not declared in this scope
    8 |         for (int i = 0; i  5; i++) {
      |                               ^
a.cc:19:22: error: expected ')' before 'sum'
   19 |         printf("%d\n" sum / 5);
      |               ~      ^~~~
      |                      )
Language: C++

 //JOI13-quest1.cpp  Defines the entry point for the console application.

#include <stdio.h>

int main(void)
{
	int temp, sum = 0;
	for (int i = 0; i < 5; i++) {
		scanf("%d", &temp);

		if (temp == 40) {
			sum += temp;
		}
		else {
			sum += 40;
		}
	}

	printf("%d\n" sum / 5);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ')' before 'sum'
   19 |         printf("%d\n" sum / 5);
      |               ~      ^~~~
      |                      )
Language: C++

#include<iostream>
int a,s;main(){for(i=0;i<5;i++){std::cin>>a;s+=a;}printf("%d\n",s/5);}

Compiler output:
a.cc:2:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int a,s;main(){for(i=0;i<5;i++){std::cin>>a;s+=a;}printf("%d\n",s/5);}
      |         ^~~~
a.cc: In function 'int main()':
a.cc:2:20: error: 'i' was not declared in this scope
    2 | int a,s;main(){for(i=0;i<5;i++){std::cin>>a;s+=a;}printf("%d\n",s/5);}
      |                    ^
Language: C++

#include<bits/stdc++.h>
int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}

Compiler output:
a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}
      |           ^~~~
a.cc: In function 'int main()':
a.cc:2:50: error: 'max' was not declared in this scope; did you mean 'std::max'?
    2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}
      |                                                  ^~~
      |                                                  std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<bits/stdc++.h>
int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}

Compiler output:
a.cc:2:11: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}
      |           ^~~~
a.cc: In function 'int main()':
a.cc:2:50: error: 'max' was not declared in this scope; did you mean 'std::max'?
    2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}
      |                                                  ^~~
      |                                                  std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:2:77: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    2 | int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}std::cout<<s/5<<endl;}
      |                                                                             ^~~~
      |                                                                             std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

n,k=5;main(m){for(;k--;n+=m<40?40:m)scanf("%d",&m);k=!printf("%d\n",n/5);}

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,k=5;main(m){for(;k--;n+=m<40?40:m)scanf("%d",&m);k=!printf("%d\n",n/5);}
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | n,k=5;main(m){for(;k--;n+=m<40?40:m)scanf("%d",&m);k=!printf("%d\n",n/5);}
      |           ^
Language: C++

5.times{n=gets.to_i;m+=n}p m/5

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 5.times{n=gets.to_i;m+=n}p m/5
      | ^~~~~~~
a.cc:1:26: error: 'p' does not name a type
    1 | 5.times{n=gets.to_i;m+=n}p m/5
      |                          ^
Language: C++


public class averagescore1 {

	public static void main(String[] args) {
import java.util.Scanner;
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

}

Compiler output:
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class averagescore1 {
      | ^~~~~~
Language: C++

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

}

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main {
      | ^~~~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int a,b,c,d,e,x;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
	x=(a+b+c+d+e)/5;
	printf("%d\n"x);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: unable to find string literal operator 'operator""x' with 'const char [4]', 'long unsigned int' arguments
    7 |         printf("%d\n"x);
      |                ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int a[5],s=0;
r(i,5)cin>>a[i];
r(i,5){
if(a[i]<40)s+=40;
else s+=a[i]
}
cout<<s/5<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before '}' token
    9 | else s+=a[i]
      |             ^
      |             ;
   10 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
int main(){
for (i=1; i<=5; i++){
    cin >> p;
    if(p < 40) { p = 40; }
   sum += p;
}
cout << sum / 5 << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:6: error: 'i' was not declared in this scope
    4 | for (i=1; i<=5; i++){
      |      ^
a.cc:5:12: error: 'p' was not declared in this scope
    5 |     cin >> p;
      |            ^
a.cc:7:4: error: 'sum' was not declared in this scope
    7 |    sum += p;
      |    ^~~
a.cc:9:9: error: 'sum' was not declared in this scope
    9 | cout << sum / 5 << endl;
      |         ^~~
Language: C++

#include <iostream>

using namespace std;

int main ()
{
	int a[i],con;

	for (int i = 0; i < 5; i++)
	{
		cin >> a;
		if (a[i] < 40)
		{
			a[i] = 0;
			a[i] = 40;
		}
		con += a[i];
	}

	cout << con / 5 << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'i' was not declared in this scope
    7 |         int a[i],con;
      |               ^
a.cc:11:24: error: 'a' was not declared in this scope
   11 |                 cin >> a;
      |                        ^
Language: C++

#include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&f);
	x=(a+b+c+d+f)/5;
	printf("%d\n",x);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'x' was not declared in this scope
    6 |         x=(a+b+c+d+f)/5;
      |         ^
Language: C++

#include<stdio.h>
#include <iostream>
#include<string>
#include<algorithm>
#include<sstream>
#include<math.h>
int main() {
	int a[5];
	int ans=0;
	for (int i = 0; i < 5; i++) {
		cin >> a[i];
		if (a[i] < 40)a[i] = 40;
		ans += a[i] / 5;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |                 cin >> a[i];
      |                 ^~~
      |                 std::cin
In file included from a.cc:2:
/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 << ans << 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:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |         cout << ans << 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 <bits/stdc++.h>
using namespace std;
int main(){
int a, b, c, d, e,f;
cin >> a, b, c, d, e;
f =(a + b + c + d + e) / 5
cout << f<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: expected ';' before 'cout'
    6 | f =(a + b + c + d + e) / 5
      |                           ^
      |                           ;
    7 | cout << f<< endl;
      | ~~~~
Language: C++

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

int main(){
   int a,b,c,d,e;
   cin>>a>>b>>c>>d>>e;
   if(a < 40) {
      a = 40
   } 
   if(b < 40) {
      b = 40
   }
   if(c < 40) {
      c = 40
   }
   if(d < 40) {
      d = 40
   }
   if(e < 40) {
      e = 40
   }
   cout << (a+b+c+d+e)/5 << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before '}' token
    8 |       a = 40
      |             ^
      |             ;
    9 |    }
      |    ~         
a.cc:11:13: error: expected ';' before '}' token
   11 |       b = 40
      |             ^
      |             ;
   12 |    }
      |    ~         
a.cc:14:13: error: expected ';' before '}' token
   14 |       c = 40
      |             ^
      |             ;
   15 |    }
      |    ~         
a.cc:17:13: error: expected ';' before '}' token
   17 |       d = 40
      |             ^
      |             ;
   18 |    }
      |    ~         
a.cc:20:13: error: expected ';' before '}' token
   20 |       e = 40
      |             ^
      |             ;
   21 |    }
      |    ~
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,c,d,e;
cin >>a>>b>>c>>d>>e;
if(a<40)
a=40;

if(b<40)
b=40;

if(c<40)
c=40;

if(d<40)
d=40;

if(e<40)
e=40;
}
cout<<(a+b+c+d+e)/5<<endl;
return 0;
}



Compiler output:
a.cc:21:1: error: 'cout' does not name a type
   21 | cout<<(a+b+c+d+e)/5<<endl;
      | ^~~~
a.cc:22:1: error: expected unqualified-id before 'return'
   22 | return 0;
      | ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,c,d,e;
cin >>a>>b>>c>>d>>e;
if(a<40)
a=40;

if(b<40)
b=40;

if(c<40)
c=40;

if(d<40)
d=40;

if(e<40)
e=40;
}
cout<<(a+b+c+d+e)/5<<endl;
return 0;
}


Compiler output:
a.cc:21:1: error: 'cout' does not name a type
   21 | cout<<(a+b+c+d+e)/5<<endl;
      | ^~~~
a.cc:22:1: error: expected unqualified-id before 'return'
   22 | return 0;
      | ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^