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

#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
long getLucasNum(int n);
int main() {
	int num;
	scanf_s("%d", &num);
	printf("%d", getLucasNum(num));
	return 0;
}

long getLucasNum(int n) {
	if (n == 0) {
		return 2;
	}
	else if (n == 1)
	{
		return 1;
	}
	else
	{
		return getLucasNum(n - 1) + getLucasNum(n - 2);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &num);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
#include<stdio.h>
int getLucasNum(int n);
int main() {
	int num;
	cin << num;
	cout >> getLucasNum(num) >> endl;
}

int getLucasNum(int n) {
	if (n == 0) {
		return 2;
	}
	else if(n==1)
	{
		return 1;
	}
	else
	{
		return getLucasNum(n - 1) + getLucasNum(n - 2);
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin << num;
      |         ^~~
      |         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:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         cout >> getLucasNum(num) >> 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:7:37: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |         cout >> getLucasNum(num) >> 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 i,n;
	scanf("%d",&n);
	long int L[n+1];
	L[0]=2;
	L[1]=1;
	for(i=2;i<=n;i++){
		L[i]=L[i-2]+L[i-1];
	}
	printf("%d\n",L[n]);
	return 0;
}

Compiler output:
main.c:2:1: error: stray '\302' in program
    2 | <U+00A0>
      | ^~~~~~~~
Language: C

#include <stdio.h>
 
int main(void){
	int i,n;
	scanf("%d",&n);
	long long int L[n+1];
	L[0]=2;
	L[1]=1;
	for(i=2;i<=n;i++){
		L[i]=L[i-2]+L[i-1];
	}
	printf("%d\n",L[n]);
	return 0;
}

Compiler output:
main.c:2:1: error: stray '\302' in program
    2 | <U+00A0>
      | ^~~~~~~~
Language: Java


import java.util.Scanner;

public class MainB {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] l = new long[n + 1];
		l[0] = 2;
		l[1] = 1;
		for(int i = 2 ; i <= n ; i++) {
			l[i] = l[i - 1] + l[i - 2];
		}
		System.out.println(l[n]);
	}
}

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

lucas 0	= 2
lucas 1	= 1
lucas x	= ls !! (x - 1) + ls !! (x - 2)

ls = [lucas x | x <- [0, 1..] ]

main :: IO()
main = do
	n <- readLn
	putStrLn $ show (lucas (n))

Compiler output:
a.cc:5:26: error: too many decimal points in number
    5 | ls = [lucas x | x <- [0, 1..] ]
      |                          ^~~
a.cc:1:1: error: 'lucas' does not name a type
    1 | lucas 0 = 2
      | ^~~~~
Language: Java



import java.util.Scanner;

public class Solution {
	static int M = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int l0=2,l1=1;
		long ans=0,pre1=l0,pre2=l1;
		for(int i=3;i<=num+1;i++) {
			long xy=pre1+pre2;
			pre1= pre2;
			pre2=xy;
			ans=xy;
		}
		System.out.println(num==1?(2):(num==2)?1:ans);
	}
}


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



import java.util.Scanner;

public class Solution {
	static int M = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int l0=2,l1=1;
		long ans=0,pre1=l0,pre2=l1;
		for(int i=2;i<=num;i++) {
			long xy=pre1+pre2;
			pre1= pre2;
			pre2=xy;
			ans=xy;
		}
		System.out.println(ans);
	}
}


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

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		
	 Scanner scanner = new Scanner(System.in);
        try {
        
        	int num = scanner.nextInt();
        	
        } catch (InputMismatchException e) {
        	
        }
        	int a[];
        	a = new int[num];
        	a[0] = 2;
        	a[1] = 1;
        	for(int i = 2;i < num; i++ ){
        		for(int g = 0;g < num; g++){
        		a[i] = a[g] + a[g+1];
        	}
        	}
        	System.out.println(a[num]);
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
        	a = new int[num];
        	            ^
  symbol:   variable num
  location: class Ideone
Main.java:25: error: cannot find symbol
        	for(int i = 2;i < num; i++ ){
        	                  ^
  symbol:   variable num
  location: class Ideone
Main.java:26: error: cannot find symbol
        		for(int g = 0;g < num; g++){
        		                  ^
  symbol:   variable num
  location: class Ideone
Main.java:30: error: cannot find symbol
        	System.out.println(a[num]);
        	                     ^
  symbol:   variable num
  location: class Ideone
4 errors
Language: Java

package atcoder.ABC079;

import java.io.IOException;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Scanner;

public class MainA {

	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		BigDecimal one = new BigDecimal("1");
		BigDecimal mone = new BigDecimal("-1");
		BigDecimal two = new BigDecimal("2");
		BigDecimal rfive = new BigDecimal(Math.sqrt(5));

		MathContext mc = new MathContext(100, RoundingMode.HALF_UP);

		BigDecimal lucas = ((one.add(rfive)).divide(two, 18, RoundingMode.HALF_UP)).pow(n, mc).add(one.divide(((one.add(rfive)).divide(two, 18, RoundingMode.HALF_UP).multiply(mone)).pow(n, mc), 18, RoundingMode.HALF_UP));

		long a = lucas.longValue();

		System.out.println(a);
	}
}


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

#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

int a[100];
int main()
{
	int n;
	a[0] = 2;
	a[1] = 1;
	scanf("%d", &n);
	if(n == 1){
		printf("2");
	}
	else if(n == 2){
		printf("3");
	}
	else{
		while( n <= 86){
		for(int i = 2; i < n-1; i++){
			a[i] = a[i-1] +a[i-2];}
		printf("%d\n", a[i]);
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:34: error: 'i' was not declared in this scope
   25 |                 printf("%d\n", a[i]);
      |                                  ^
Language: C++

#include <iostream>
#include <sstream>

int main() {

	unsigned __int64 l1 = 2, l2 = 1, l3;
	int n, i;
	std::cin >> n;

	for (i = 0; i < n - 1; i++)
	{
		l3 = l1 + l2;
		l1 = l2;
		l2 = l3;
	}
	if (n > 1 && n < 87) { std::cout << l3 ; }
	if (n == 1) { std::cout << 1 ; }

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: expected initializer before 'l1'
    6 |         unsigned __int64 l1 = 2, l2 = 1, l3;
      |                          ^~
a.cc:12:17: error: 'l3' was not declared in this scope
   12 |                 l3 = l1 + l2;
      |                 ^~
a.cc:12:22: error: 'l1' was not declared in this scope
   12 |                 l3 = l1 + l2;
      |                      ^~
a.cc:12:27: error: 'l2' was not declared in this scope
   12 |                 l3 = l1 + l2;
      |                           ^~
a.cc:16:45: error: 'l3' was not declared in this scope
   16 |         if (n > 1 && n < 87) { std::cout << l3 ; }
      |                                             ^~
Language: C++

#include <iostream>
#include <sstream>

int main() {

	unsigned __int64 l1 = 2, l2 = 1, l3;
	unsigned __int64 n, i;
	std::cin >> n;

	for (i = 0; i < n - 1; i++)
	{
		l3 = l1 + l2;
		l1 = l2;
		l2 = l3;
	}
	if (n > 1 && n < 87) { std::cout << l3 << std::endl; }
	if (n == 1) { std::cout << 1 << std::endl; }

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: expected initializer before 'l1'
    6 |         unsigned __int64 l1 = 2, l2 = 1, l3;
      |                          ^~
a.cc:7:26: error: expected initializer before 'n'
    7 |         unsigned __int64 n, i;
      |                          ^
a.cc:8:21: error: 'n' was not declared in this scope
    8 |         std::cin >> n;
      |                     ^
a.cc:10:14: error: 'i' was not declared in this scope
   10 |         for (i = 0; i < n - 1; i++)
      |              ^
a.cc:12:17: error: 'l3' was not declared in this scope
   12 |                 l3 = l1 + l2;
      |                 ^~
a.cc:12:22: error: 'l1' was not declared in this scope
   12 |                 l3 = l1 + l2;
      |                      ^~
a.cc:12:27: error: 'l2' was not declared in this scope
   12 |                 l3 = l1 + l2;
      |                           ^~
a.cc:16:45: error: 'l3' was not declared in this scope
   16 |         if (n > 1 && n < 87) { std::cout << l3 << std::endl; }
      |                                             ^~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

long long a[100];
int main()
{
	int N;
	scanf("%d",&N);
	a[0] = 2;
	a[1] = 1;
	for(i = 2; i <= N; i++)
	{
		a[i] = a[i-1] + a[i-2];
	}
	printf("%lld",a[N]);
	return 0;
}


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

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

long long int L[87]={0};
int n;
L[0]=2;L[1]=1

void make_lucas(int n){
    if(L[n]==0){
        L[n]=L[n-1]+L[n-2]
    }
    else{
        return L[n];
    }
}

int main(){

    cin>>n;
    make_lucas(87);
    cout<<L[n]<<endl;

    return 0;
}



Compiler output:
a.cc:6:1: error: 'L' does not name a type
    6 | L[0]=2;L[1]=1
      | ^
a.cc:6:8: error: 'L' does not name a type
    6 | L[0]=2;L[1]=1
      |        ^
a.cc: In function 'int main()':
a.cc:20:5: error: 'make_lucas' was not declared in this scope
   20 |     make_lucas(87);
      |     ^~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int Lucas(int n){
int dp[86] = {0};
dp[0] = 2;
dp[1] = 1;
for (int i =2; i < n+1; i++)
  {
    dp[i] = dp[i-1] + dp[i-2]
  }
  return dp[n];
} 

int main() {
  int a; //入力
  int L; //出力
  cin >> a;
  L = Lucas(a);
  cout << L << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int Lucas(int)':
a.cc:10:30: error: expected ';' before '}' token
   10 |     dp[i] = dp[i-1] + dp[i-2]
      |                              ^
      |                              ;
   11 |   }
      |   ~
Language: C++

import java.util.Scanner;

class BB{
    static double power(double a,int n){
        double re=1.0;
        for(int i=0;i<n;i++)
         re*=a;
        return re;
    }
    static long Locus(int N){
        double a,b;
        a=power(((1-Math.sqrt(5))/2),N);
        b=power(((1+Math.sqrt(5))/2),N);
        return (long)(a+b);
    }
    public static void main(String args[]){
        Scanner stdIn=new Scanner(System.in);
        int N=stdIn.nextInt();
        System.out.println(Locus(N));
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:16:11: error: expected ':' before 'static'
   16 |     public static void main(String args[]){
      |           ^~~~~~~
      |           :
a.cc:16:29: error: 'String' has not been declared
   16 |     public static void main(String args[]){
      |                             ^~~~~~
a.cc:21:2: error: expected ';' after class definition
   21 | }
      |  ^
      |  ;
a.cc: In static member function 'static long int BB::Locus(int)':
a.cc:12:21: error: 'Math' was not declared in this scope
   12 |         a=power(((1-Math.sqrt(5))/2),N);
      |                     ^~~~
a.cc: In static member function 'static void BB::main(int*)':
a.cc:17:9: error: 'Scanner' was not declared in this scope
   17 |         Scanner stdIn=new Scanner(System.in);
      |         ^~~~~~~
a.cc:18:15: error: 'stdIn' was not declared in this scope; did you mean 'std'?
   18 |         int N=stdIn.nextInt();
      |               ^~~~~
      |               std
a.cc:19:9: error: 'System' was not declared in this scope
   19 |         System.out.println(Locus(N));
      |         ^~~~~~
Language: C

#include <stdio.h>

int main(void)
{
	__int64 n, l[90] = {2, 1}, i;

	for (i = 2; i <= 86; i++)
		l[i] = l[i - 1] + l[i - 2];

	scanf("%I64d", &n);
	printf("%I64d\n", l[n]);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'?
    5 |         __int64 n, l[90] = {2, 1}, i;
      |         ^~~~~~~
      |         __int64_t
Language: C

#include<stdio.h>
int main()
{
	int i;
	__int64 a[87],n;
	a[0]=2;
	a[1]=1;
	for(i=2;i<87;i++)
		a[i]=a[i-1]+a[i-2];
	scanf("%I64d",&n);
	printf("%I64d\n",a[n]); 
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'?
    5 |         __int64 a[87],n;
      |         ^~~~~~~
      |         __int64_t
Language: C++

#include<stdio.h>
int main()
{
	__int64 a[87],n,i;
	a[0]=2;
	a[1]=1;
	for(i=2;i<87;i++)
		a[i]=a[i-1]+a[i-2];
	scanf("%I64d",&n);
	printf("%I64d\n",a[n]); 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    4 |         __int64 a[87],n,i;
      |         ^~~~~~~
      |         __int64_t
a.cc:5:9: error: 'a' was not declared in this scope
    5 |         a[0]=2;
      |         ^
a.cc:7:13: error: 'i' was not declared in this scope
    7 |         for(i=2;i<87;i++)
      |             ^
a.cc:9:24: error: 'n' was not declared in this scope
    9 |         scanf("%I64d",&n);
      |                        ^
Language: C

#include<stdio.h>
int main()
{
	__int64 a[87],n,i;
	a[0]=2;
	a[1]=1;
	for(i=2;i<87;i++)
		a[i]=a[i-1]+a[i-2];
	scanf("%I64d",&n);
	printf("%I64d\n",a[n]); 
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'?
    4 |         __int64 a[87],n,i;
      |         ^~~~~~~
      |         __int64_t
Language: C++

    #include<cstdio>
    int main()
    {
    	long long int a[100];
    	int n;
    	a[0]=2,a[1]=1,a[86]=939587134549734843;
    	while(~scanf("%d",&n)){
    	if(n==0)
    	{
    		printf("%lld",a[0]);
    	}
    	else if(n==1)
    	{
    		printf("%lld",a[1]);
    	}
    	else
    	{
    		for(int i=2;i<=n;i++)
    		{
    			a[i]=a[i-1]+a[i-2];
    		}
    	}
    	printf("%lld\n",a[n]);}
    	return 0;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: expected '}' at end of input
   24 |         return 0;
      |                  ^
a.cc:3:5: note: to match this '{'
    3 |     {
      |     ^
Language: C

#include <stdio.h>
int rec(int n)
{
  if(n==0)
    return 2;
  else if(n==1)
    return 1;
  else 
    return (rec(n-1)+rec(n-2));
void main()
{
  int n;
  scanf("%d",&n);
  r=rec(n);
  printf("%d",r);
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: 'r' undeclared (first use in this function)
   14 |   r=rec(n);
      |   ^
main.c:14:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'rec':
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C++

#include<cstdio>
int main()
{
	long long int a[100];
	int n;
	a[0]=2,a[1]=1,a[86]=939587134549734843;
	scanf("%d",&n))
	if(n==0)
	{
		printf("%lld",a[0]);
	}
	else if(n==1)
	{
		printf("%lld",a[1]);
	}
	else if(n==86)
	{
		return a[86];
	}
	else
	{
		for(int i=2;i<=n;i++)
		{
			a[i]=a[i-1]+a[i-2];
		}
	}
	printf("%lld\n",a[n-1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before ')' token
    7 |         scanf("%d",&n))
      |                       ^
      |                       ;
a.cc:12:9: error: 'else' without a previous 'if'
   12 |         else if(n==1)
      |         ^~~~
Language: Java

import java.util.Scanner;
import java.Math.BigInteger;
 
public class Main {
 
	public static void main(String[] args) {
		no2();
	}
 
 	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
 	    int n = 5;
 	    
        BigInteger f0 = new BigInteger(2);
        BigInteger f1 = new Biginteger(1);
        Biginteger f2;
        
        if(n==1){
				System.out.println(f0);
				return;
        }
        if(n==2){
				System.out.println(f1);
				return;
        }
        
        for(int i = 3;i <= n; i++){
            f2 = f0.add(f1);
            f0 = f1;
            f1 = f2;
        }
        
		System.out.println(f2);
	}
}
 
}

Compiler output:
Main.java:2: error: package java.Math does not exist
import java.Math.BigInteger;
                ^
Main.java:14: error: cannot find symbol
        BigInteger f0 = new BigInteger(2);
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:14: error: cannot find symbol
        BigInteger f0 = new BigInteger(2);
                            ^
  symbol:   class BigInteger
  location: class Main
Main.java:15: error: cannot find symbol
        BigInteger f1 = new Biginteger(1);
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:15: error: cannot find symbol
        BigInteger f1 = new Biginteger(1);
                            ^
  symbol:   class Biginteger
  location: class Main
Main.java:16: error: cannot find symbol
        Biginteger f2;
        ^
  symbol:   class Biginteger
  location: class Main
6 errors
Language: Java

import java.util.Scanner;
import java.Math.BigInteger;
 
public class Main {
 
	public static void main(String[] args) {
		no2();
	}
 
 	static void no2() {
		try (Scanner sc = new Scanner(System.in)) {
 	    int n = 5;
 	    
        BigInteger f0 = new BigInteger(2);
        BigInteger f1 = new Biginteger(1);
        Biginteger f2;
        
        if(n==1){
				System.out.println(f0);
				return;
        }
        if(n==2){
				System.out.println(f1);
				return;
        }
        
        for(int i = 3;i =< n; i++){
            f2 = f0.add(f1);
            f0 = f1;
            f1 = f2;
        }
        
		System.out.println(f2);
	}
}
 
}

Compiler output:
Main.java:27: error: > or ',' expected
        for(int i = 3;i =< n; i++){
                            ^
1 error
Language: C++

#include<iostream>
using namespace std;

int Lucas(int n){
  if(n == 0)
  return 2;
  else
  {
    if(n == 1)
    return 1;

    else
    {
      return Lucas(n-1)+Lucas(n-2);
    }
  }
}

int main() {
  int a; //入力
  int L; //出力
  cin >> a;
  L = Lucas(a);
  cout << L << endl;
  }
  
  return 0;
}

Compiler output:
a.cc:27:3: error: expected unqualified-id before 'return'
   27 |   return 0;
      |   ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

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

int main(){
   int n;
  cin >> n;	
	int a[n];
{
	int i;
	a[1]=2;
	a[2]=1;
	for(i=3; i<=n;i++)
		a[i]=a[i-1]+a[i-2];
}
cout << X(n) << endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'X' was not declared in this scope
   15 | cout << X(n) << endl;
      |         ^
Language: C

#include <stdio.h>
#include <math.h>
int main(){
int a;
scanf("%d",&a);
double  b[a+1];
b[0]=2;
b[1]=1;
 
for(int i=2;i<=a;i++){
b[i]=b[i-1]+b[i-2];
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: expected declaration or statement at end of input
   12 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

int Lucas(int n){
  if(n == 0)
  return 2;
  else
  {
    if(n == 1)
    return 1;

    else
    {
      return Lucas(n-1)+Lucas(n-2);
    }
}

int main() {
  int a; //入力
  int L; //出力
  cin << a;
  L = Lucas(a);
  cout >> L >> endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int Lucas(int)':
a.cc:18:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   18 | int main() {
      |         ^~
a.cc:18:9: note: remove parentheses to default-initialize a variable
   18 | int main() {
      |         ^~
      |         --
a.cc:18:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:18:12: error: a function-definition is not allowed here before '{' token
   18 | int main() {
      |            ^
Language: C++

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

int main(){
   int n;
  cin >> n;	
	int vector X(n);
{
	int i;
	X(0)=2;
	X(1)=1;
	for(i=2; i<=n;i++)
		X(i)=X(i-1)+X(i-2)
}
cout << X(n) << endl;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected initializer before 'X'
    7 |         int vector X(n);
      |                    ^
a.cc:10:9: error: 'X' was not declared in this scope
   10 |         X(0)=2;
      |         ^
a.cc:15:9: error: 'X' was not declared in this scope
   15 | cout << X(n) << endl;
      |         ^
Language: C++

#include<iostream>
using namespace std;

int Lucas(int n){
  if(n == 0)
  return 2;
  else
  {
    if(a == 1)
    return 1;

    else
    {
      return Lucas(n-1)+Lucas(n-2);
    }
}

int main() {
  int a; //入力
  int L; //出力
  cin << a;
  L = Lucas(a);
  cout >> L >> endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int Lucas(int)':
a.cc:9:8: error: 'a' was not declared in this scope
    9 |     if(a == 1)
      |        ^
a.cc:18:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   18 | int main() {
      |         ^~
a.cc:18:9: note: remove parentheses to default-initialize a variable
   18 | int main() {
      |         ^~
      |         --
a.cc:18:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:18:12: error: a function-definition is not allowed here before '{' token
   18 | int main() {
      |            ^
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
using namespace std;
const long long Max = 1e9;

long long l[Max + 5];
int n;

int main()
{
	cin>>n;
	l[0] = 2,l[1] = 1;
	if(n == 1) cout<<l[1]<<endl;
	else
	{
		for(int i = 2 ; i <= n; i++)
		{
			l[i] = l[i-1] + l[i-2];
		}
		cout<<l[n]<<endl;
	}
	return 0;
}


Compiler output:
/tmp/ccYKZCoh.o: in function `main':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccYKZCoh.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccYKZCoh.o
a.cc:(.text+0xd3): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccYKZCoh.o
a.cc:(.text+0xde): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccYKZCoh.o
collect2: error: ld returned 1 exit status
Language: C++

    #include <stdio.h>
    int main(void) {
    	int n;
    	long long int a,b=-1,c=2;
    	scanf("%d", &n);
    	for (int i = 0;i < n;i++) {
    		a = b;
    		b = c;
    		c = a + b;
    	}
    	printf("%d\n", c);
    	return 0;
    }

#include <stdio.h>
int main(void) {
	int n;
	long long int a,b=-1,c=2;
	scanf("%d", &n);
	for (int i = 0;i < n;i++) {
		a = b;
		b = c;
		c = a + b;
	}
	printf("%lld\n", c);
	return 0;
}

Compiler output:
a.cc:16:5: error: redefinition of 'int main()'
   16 | int main(void) {
      |     ^~~~
a.cc:2:9: note: 'int main()' previously defined here
    2 |     int main(void) {
      |         ^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>     /* exit(  )で必要 */

#define MAX_VAL 100
unsigned long result[MAX_VAL];    /* ここに計算結果を保存 */

  /* nのフィボナッチ数を返す */
unsigned long luca3(int n)
{
    int i;

    result[1] = 1;	/* n が 1 なら result[1] は 1 */
    result[2] = 1;	/* n が 2 なら result[2] は 1 */

      /* nが１か２ならこのループは実行されない */
    for (i = 3; i <= n; i++)/* 計算結果を蓄えながら計算を進める */
        result[i] = result[i - 1] + result[i - 2];

    return (result[n]);
}

void main(void)
{
    int n;  
 	 cin >> n;
cout << luca3(n) << endl;
 return 0;
}


Compiler output:
a.cc:22:1: error: '::main' must return 'int'
   22 | void main(void)
      | ^~~~
a.cc: In function 'int main()':
a.cc:25:10: error: 'cin' was not declared in this scope
   25 |          cin >> n;
      |          ^~~
a.cc:26:1: error: 'cout' was not declared in this scope
   26 | cout << luca3(n) << endl;
      | ^~~~
a.cc:26:21: error: 'endl' was not declared in this scope
   26 | cout << luca3(n) << endl;
      |                     ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
  int n,i,a;
  vector<int> l;
  cin >> n;
  l.push_back(2);
  l.push_back(1);
  for(i=0;i<n;i++)
  {
    a=l[i]+l[i+1];
    l.push_back(a);

  cout << l[n];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;

long long qq(int a)
{
	long long k;
	if( a == 0) return 2;
	if( a == 1) return 1;
	if( a > 1)
	{
		k = qq(a - 1) + qq(a - 2);
		return k;
	}
}

int main()
{
	int a;
	scanf("%d",&a);
	printf("%lld\n",qq(a));
	

Compiler output:
a.cc: In function 'int main()':
a.cc:23:32: error: expected '}' at end of input
   23 |         printf("%lld\n",qq(a));
      |                                ^
a.cc:20:1: note: to match this '{'
   20 | {
      | ^
a.cc: In function 'long long int qq(int)':
a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
Language: C++

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

int main(){
   int n;
  cin >> n;	
int a(int x){
	if(x == 0){
		return 2;
	}else if(x == 1){
		return 1;
	}else if(a(x) != 0){
		return a(x);
	}
	a(x) = a(x-1) + a(x-2);
}
cout << a[n] << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: a function-definition is not allowed here before '{' token
    7 | int a(int x){
      |             ^
a.cc:17:9: error: 'a' was not declared in this scope
   17 | cout << a[n] << endl;
      |         ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int a;
    cin>>a;
int r[i]=0;
int r[0]=2;
int r[1]=1;


for(i=2;i>0;i++){
    if(r[i]>a){
r[i]=r[i-1]+r[i-2];
    break;
    }
    cout<<r[i]<<endl;
}//a(n+2)=a(n+1)+a(n)


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 | int r[i]=0;
      |       ^
a.cc:7:10: error: array must be initialized with a brace-enclosed initializer
    7 | int r[0]=2;
      |          ^
a.cc:8:5: error: conflicting declaration 'int r [1]'
    8 | int r[1]=1;
      |     ^
a.cc:7:5: note: previous declaration as 'int r [0]'
    7 | int r[0]=2;
      |     ^
a.cc:17:2: error: expected '}' at end of input
   17 | }//a(n+2)=a(n+1)+a(n)
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

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

int main(){
   int n;
  cin >> n;	
int a[int x]{
	if(x == 0){
		return 2;
	}else if(x == 1){
		return 1;
	}else if(a[x] != 0){
		return a[x];
	}
	a[x] = a[x-1] + a[x-2];
}
cout << a[n] << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected primary-expression before 'int'
    7 | int a[int x]{
      |       ^~~
a.cc:7:7: error: expected ']' before 'int'
    7 | int a[int x]{
      |       ^~~
      |       ]
a.cc:17:9: error: 'a' was not declared in this scope
   17 | cout << a[n] << endl;
      |         ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(){
	int i,n;
	__int64 a[100]={2,1};
	for(i=2;i<=86;i++)
	a[i]=a[i-1]+a[i-2];
	while(scanf("%d",&n)!=EOF)
	printf("%I64d\n",a[n]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    5 |         __int64 a[100]={2,1};
      |         ^~~~~~~
      |         __int64_t
a.cc:7:9: error: 'a' was not declared in this scope
    7 |         a[i]=a[i-1]+a[i-2];
      |         ^
a.cc:9:26: error: 'a' was not declared in this scope
    9 |         printf("%I64d\n",a[n]);
      |                          ^
Language: C++

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

int main(){
   int q;
  cin >> q;	
class MemorizeFibonacci:public Fibonacci{
	int memo[10000] = {0};
public:
	virtual int calc(int x);
};

int MemorizeFibonacci::calc(int x){
	if(x == 0){
		return 2;
	}else if(x == 1){
		return 1;
	}else if(memo[x] != 0){
		return memo[x];
	}
	memo[x] = calc(x-1) + calc(x-2);
}
cout << memo[q] << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected class-name before '{' token
    7 | class MemorizeFibonacci:public Fibonacci{
      |                                         ^
a.cc:13:28: error: qualified-id in declaration before '(' token
   13 | int MemorizeFibonacci::calc(int x){
      |                            ^
a.cc:23:9: error: 'memo' was not declared in this scope
   23 | cout << memo[q] << endl;
      |         ^~~~
Language: Java

public class Main {
	public static void main(String[] args) {
	    java.util.Scanner scanner = new java.util.Scanner(System.in);
	    int n = scanner.nextInt();
	    long l0 = 2;
	    long l1 = 1;
	    if (n == 1) {
	    	System.out.println(l1);
	    	return;
	    }
	    long l2 = l1 + l0;
	    if (n == 2) {
	    	System.out.println(l2);
	    	return;
	    }
	    for (int i = 2; i < n; i++) {
	    	long next = l2 + l1;
	    	l0 = l1;
	    	l1 = l2;
	    	l2 = next;
	    }
	    System.out.println(l2);
	}


Compiler output:
Main.java:23: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

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

int main(){
   int n;
  cin >> n;	
class MemorizeFibonacci:public Fibonacci{
	int memo[10000] = {0};
public:
	virtual int calc(int x);
};

int MemorizeFibonacci::calc(int x){
	if(x == 0){
		return 2;
	}else if(x == 1){
		return 1;
	}else if(memo[x] != 0){
		return memo[x];
	}
	memo[x] = calc(x-1) + calc(x-2);
}
cout << memo[n] << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected class-name before '{' token
    7 | class MemorizeFibonacci:public Fibonacci{
      |                                         ^
a.cc:13:28: error: qualified-id in declaration before '(' token
   13 | int MemorizeFibonacci::calc(int x){
      |                            ^
a.cc:23:9: error: 'memo' was not declared in this scope
   23 | cout << memo[n] << endl;
      |         ^~~~
Language: C++

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

int main(){
   int n;
  cin >> n;	
class MemorizeFibonacci:public Fibonacci{
	int memo[10000] = {0};
public:
	virtual int calc(int x);
};

int MemorizeFibonacci::calc(int x){
	if(x == 0){
		return 2;
	}else if(x == 1){
		return 1;
	}else if(memo[x] != 0){
		return memo[x];
	}
	memo[x] = calc(x-1) + calc(x-2);
}
cout << memo[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected class-name before '{' token
    7 | class MemorizeFibonacci:public Fibonacci{
      |                                         ^
a.cc:13:28: error: qualified-id in declaration before '(' token
   13 | int MemorizeFibonacci::calc(int x){
      |                            ^
a.cc:23:9: error: 'memo' was not declared in this scope
   23 | cout << memo[n] << endl;
      |         ^~~~
Language: C++

#include<cstdio>
int main()
{
	long long int a[100];
	int n;
	a[0]=2,a[1]=1;
	while(~scanf("%d",&n))
	if(n==0)
	{
		printf("%lld",a[0]);
	}
	else if(n==1)
	{
		printf("%lld",a[1]);
	}
	else
	{
		for(int i=2;i<=n;i++)
		{
			a[i]=a[i-1]+a[i-2];
		}
	}
	printf("%lld\n",a[n]);
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: expected '}' at end of input
   24 |         return 0;
      |                  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: Java

import java.util.*;
import java.math.*;
import java.io.*;
import java.lang.*;
/**
 * Created by Abduali on 10.10.2017.
 */
public class Main {

    public static void main(String[] args) throws IOException{
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bufferedReader.readLine());
        System.out.print(fact(n));
    }


    private static BigInteger fact(int n){
        BigInteger res = BigInteger.ONE;
      if(res==0){
        return 2;
      }
      else if(res==1){
        return 1;
      }
      else
        return fact(res-1)+ fact(res-2);
    }
}


Compiler output:
Main.java:19: error: bad operand types for binary operator '=='
      if(res==0){
            ^
  first type:  BigInteger
  second type: int
Main.java:20: error: incompatible types: int cannot be converted to BigInteger
        return 2;
               ^
Main.java:22: error: bad operand types for binary operator '=='
      else if(res==1){
                 ^
  first type:  BigInteger
  second type: int
Main.java:23: error: incompatible types: int cannot be converted to BigInteger
        return 1;
               ^
Main.java:26: error: bad operand types for binary operator '-'
        return fact(res-1)+ fact(res-2);
                       ^
  first type:  BigInteger
  second type: int
Main.java:26: error: bad operand types for binary operator '-'
        return fact(res-1)+ fact(res-2);
                                    ^
  first type:  BigInteger
  second type: int
6 errors
Language: C

#include <stdio.h>
int main(){
int a;
scanf("%d",&a);
int b[a+1];
b[0]=2;
b[1]=1;
 
for(int i=2;i=<a;i++){
b[i]=b[i-1]+b[i-2];
}

printf("%d",b[(a)]);
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: expected expression before '<' token
    9 | for(int i=2;i=<a;i++){
      |               ^
Language: C++

#include <string>
#include <vector>


using namespace std;

int main()
{
    unsigned long long int n,atai,hozi1,hozi2;
    std::cin >>n;
    for(int a = 0;a < n + 1;a++){
        if(a == 0){
            atai = 2;
            hozi1 = atai;
        }
        if(a == 1){
            atai = 1;
            hozi2;
        }
        if(a >= 2){
            atai = hozi1 + hozi2;
        }
        if((a % 2) == 0){
            hozi1 = atai;
        }else{
            hozi2 = atai;
        }
    }
    std::cout <<atai<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'cin' is not a member of 'std'
   10 |     std::cin >>n;
      |          ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <vector>
  +++ |+#include <iostream>
    3 | 
a.cc:29:10: error: 'cout' is not a member of 'std'
   29 |     std::cout <<atai<<endl;
      |          ^~~~
a.cc:29:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:23: error: 'endl' was not declared in this scope
   29 |     std::cout <<atai<<endl;
      |                       ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <vector>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
    int n,i,j;
    __int64 s=0,a[88];
    a[0]=2;a[1]=1;
    for(i=2;i<=86;i++){
        a[i]=a[i-1]+a[i-2];
    }
    scanf("%d",&n);
    printf("%I64d\n",a[n]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    7 |     __int64 s=0,a[88];
      |     ^~~~~~~
      |     __int64_t
a.cc:8:5: error: 'a' was not declared in this scope
    8 |     a[0]=2;a[1]=1;
      |     ^
Language: C++

#include <iostream>
using namespace std;

long long Lucas( long long & L0, long long & L1 )
{
long long rez;
rez = L1;
L1 = L0 + L1;
L0 = rez;
return L1;
}

int main()
{
int N;
cin >> N;
long long rez = 0;
long long L0 = 2;
long long L1 = 1; 

for (i=1; i<=N; i++)
{
rez += Lucas(L0, L1);
}

return 0;
}

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

#include <stdio.h>

int main(void) {
	long long int luc[86];
	int N;
	luc[0] = 2;
	luc[1] = 1;

	scanf("%d", &N);
	for(i = 2; i < 86; i++) {
		luc[i] = luc[i-1] + luc[i-2];
	}
	printf("%d", luc[N]);

	return 0;
}		 

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

#include<iostream>
using namespace std;
int main()
{
  int n,i,a;
  vector<int> l[2]={2,1};
  for(i=2;i<n;i++)
  {
    a=l[i-2]+l[i-1];
    l.push_back(a);
  }
  cout << l[n-1];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> l[2]={2,1};
      |   ^~~~~~
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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> l[2]={2,1};
      |          ^~~
a.cc:9:7: error: 'l' was not declared in this scope
    9 |     a=l[i-2]+l[i-1];
      |       ^
a.cc:12:11: error: 'l' was not declared in this scope
   12 |   cout << l[n-1];
      |           ^
Language: C++

#include <iostream>
using namespace std;

#typedef long long ll;

int main(void){
	int n,i;
	ll l[100];
	cin >> n;
	l[0]=2;
	l[1]=1;
	for(i=2; i<=n; i++){
		l[i] = l[i-1] + l[i-2]; 
	}
	cout << l[n] << endl;
	return 0;
}


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #typedef
    4 | #typedef long long ll;
      |  ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'll' was not declared in this scope
    8 |         ll l[100];
      |         ^~
a.cc:10:9: error: 'l' was not declared in this scope
   10 |         l[0]=2;
      |         ^
Language: C++

#include<stdio.h>
int main()
{
	__int64 f[90],i,t;
   while(scanf("%I64d",&t)!=EOF)
   {
   	f[0]=2;f[1]=1;
   	for(i=2;i<=t;i++)
   	{
	  f[i]=f[i-1]+f[i-2]; 	
	   }
	   printf("%I64d\n",f[t]);
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    4 |         __int64 f[90],i,t;
      |         ^~~~~~~
      |         __int64_t
a.cc:5:25: error: 't' was not declared in this scope
    5 |    while(scanf("%I64d",&t)!=EOF)
      |                         ^
a.cc:7:9: error: 'f' was not declared in this scope
    7 |         f[0]=2;f[1]=1;
      |         ^
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=2;i<=t;i++)
      |             ^
Language: C++

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

int main()
{
   string S,T;
   cin >> S;
   int sum = stoi(S[0]);
   int mask,i;
   for(mask = 0; mask<(1<<3);mask++){
      for(i = 0; i < 3;i++){
         T = S.at(i+1);
         if(mask & (1<<i)){
            sum += stoi(T);
         }else {
            sum -= stoi(T);
         }
      }
      if(sum == 7)break;
      sum = S[0];
   }
   cout << S[0];
   for(int i = 0; i < 3;i++){
      if(mask & (1<<i)){
         cout << "+" << S[i+1];
      }else{
         cout << "-" << S[i+1];
      }
   }
   cout << "=7" <<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    8 |    int sum = stoi(S[0]);
      |              ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int A,B,C,D;
    cin >>A>>B>>C>>D;
    if(A+B+C+D==7){
        cout<<A+B+C+D=7<<endl;
    }
    else if(A+B+C-D==7){
        cout<<A+B+C-D=7<<endl;
    }
    else if(A+B-C+D==7){
        cout<<A+B-C+D=7<<endl;
    }
    else if(A+B-C-D==7){
        cout<<A+B-C-D=7<<endl;
    }
    else if(A-B+C+D==7){
        cout<<A-B+C+D=7<<endl;
    }
    else if(A-B+C-D==7){
        cout<<A-B+C-D=7<<endl;
    }
    else if(A-B-C-D==7){
        cout<<A-B-C-D=7<<endl;
    }
    else if(A-B-C+D==7){
        cout<<A-B-C+D=7<<endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |         cout<<A+B+C+D=7<<endl;
      |                       ~^~~~~~
a.cc:11:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   11 |         cout<<A+B+C-D=7<<endl;
      |                       ~^~~~~~
a.cc:14:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |         cout<<A+B-C+D=7<<endl;
      |                       ~^~~~~~
a.cc:17:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |         cout<<A+B-C-D=7<<endl;
      |                       ~^~~~~~
a.cc:20:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 |         cout<<A-B+C+D=7<<endl;
      |                       ~^~~~~~
a.cc:23:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   23 |         cout<<A-B+C-D=7<<endl;
      |                       ~^~~~~~
a.cc:26:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   26 |         cout<<A-B-C-D=7<<endl;
      |                       ~^~~~~~
a.cc:29:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   29 |         cout<<A-B-C+D=7<<endl;
      |                       ~^~~~~~
a.cc:30:6: error: expected '}' at end of input
   30 |     }
      |      ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using PLL = pair<LL,LL>;
using VPI = vector<PII>;
using VPL = vector<PLL>;
using VB = vector<bool>;
using VVB = vector<VB>;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
	//i=m -> n-1(昇順)
#define RREP(i,m,n) for(int i=(m);i>=(n);i--)
	//i=m -> n(降順)

int main(){
  string s;
  cin >> s;
  VI a(4);
  REP(i,0,4){
    a[i] = s[i];
  }
  
  if(a[0]+a[1]+a[2]+a[3] = 7){
    cout << a[0] << "+" << a[1] << "+" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]+a[1]+a[2]-a[3] = 7){
    cout << a[0] << "+" << a[1] << "+" << a[2] << "-" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]+a[1]-a[2]+a[3] = 7){
    cout << a[0] << "+" << a[1] << "-" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]+a[1]-a[2]-a[3] = 7){
    cout << a[0] << "+" << a[1] << "-" << a[2] << "-" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]-a[1]+a[2]+a[3] = 7){
    cout << a[0] << "-" << a[1] << "+" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]-a[1]+a[2]-a[3] = 7){
    cout << a[0] << "-" << a[1] << "+" << a[2] << "-" << a[3] << "=7" << endl;
    return 0;
  }
  if(a[0]-a[1]-a[2]+a[3] = 7){
    cout << a[0] << "-" << a[1] << "-" << a[2] << "+" << a[3] << "=7" << endl;
    return 0;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: lvalue required as left operand of assignment
   29 |   if(a[0]+a[1]+a[2]+a[3] = 7){
a.cc:33:20: error: lvalue required as left operand of assignment
   33 |   if(a[0]+a[1]+a[2]-a[3] = 7){
a.cc:37:20: error: lvalue required as left operand of assignment
   37 |   if(a[0]+a[1]-a[2]+a[3] = 7){
a.cc:41:20: error: lvalue required as left operand of assignment
   41 |   if(a[0]+a[1]-a[2]-a[3] = 7){
a.cc:45:20: error: lvalue required as left operand of assignment
   45 |   if(a[0]-a[1]+a[2]+a[3] = 7){
a.cc:49:20: error: lvalue required as left operand of assignment
   49 |   if(a[0]-a[1]+a[2]-a[3] = 7){
a.cc:53:20: error: lvalue required as left operand of assignment
   53 |   if(a[0]-a[1]-a[2]+a[3] = 7){