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

#include

int main(void){
 int N;
 scanf("%d", &N);
 if((N + 1)/2  != N/2)printf("%d\n", N*2);
 else printf("%d\n", N);
 return 0;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:5:2: error: 'scanf' was not declared in this scope
    5 |  scanf("%d", &N);
      |  ^~~~~
a.cc:6:23: error: 'printf' was not declared in this scope
    6 |  if((N + 1)/2  != N/2)printf("%d\n", N*2);
      |                       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #include
a.cc:7:7: error: 'printf' was not declared in this scope
    7 |  else printf("%d\n", N);
      |       ^~~~~~
a.cc:7:7: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include<stdio.h>
 
int main (void){
int N;
scanf("%d",&N);
if (N%2==o) printf ("%d", N);
if (N%2==1) printf ("%d", N*2);
return o;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'o' was not declared in this scope
    6 | if (N%2==o) printf ("%d", N);
      |          ^
a.cc:8:8: error: 'o' was not declared in this scope
    8 | return o;
      |        ^
Language: C++

#include<stdio.h>
 
intmain(void){
  int N,x;
        printf("N: ");
        fgets(buf, 127, stdin);
        sscanf(buf, "%d", &N);
  if(N==2){
  x=2;
  }else{
  x = 2 * N
  }
  printf("Answer: %d\n",x);
  
  return 0;
}

Compiler output:
a.cc:3:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
    3 | intmain(void){
      | ^~~~~~~
a.cc: In function 'int intmain()':
a.cc:6:15: error: 'buf' was not declared in this scope
    6 |         fgets(buf, 127, stdin);
      |               ^~~
a.cc:11:12: error: expected ';' before '}' token
   11 |   x = 2 * N
      |            ^
      |            ;
   12 |   }
      |   ~
Language: C++

#include<studio.h>

intmain(void){
  int N,x;
        printf("N: ");
        fgets(buf, 127, stdin);
        sscanf(buf, "%d", &N);
  if(N==2){
  x=2;
  }else{
  x = 2 * N
  }
  printf("Answer: %d\n",x);
  
  return 0;
}

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

 1 #include <stdio.h>
  2 
  3 int main(void) {
  4     int n;
  5     scanf("%d", &n);
  6     if (n % 2 == 0) {
  7     ¦   printf("%d\n" , n);
  8     } else {
  9     ¦   printf("%d\n", n * 2);
 10     }
 11     return 0;
 12 }


Compiler output:
main.c:1:2: error: expected identifier or '(' before numeric constant
    1 |  1 #include <stdio.h>
      |  ^
main.c:1:4: error: stray '#' in program
    1 |  1 #include <stdio.h>
      |    ^
main.c:7:9: error: stray '\302' in program
    7 |   7     <U+00A6>   printf("%d\n" , n);
      |         ^~~~~~~~
main.c:9:9: error: stray '\302' in program
    9 |   9     <U+00A6>   printf("%d\n", n * 2);
      |         ^~~~~~~~
Language: C++

#include<stdio.h>
 
int main (void){
int N;
scan("%d",&N);
if (N%2==o) printf ("%d", N);
if (N%2==1) printf ("%d", N*2);
return o;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'scan' was not declared in this scope; did you mean 'scanf'?
    5 | scan("%d",&N);
      | ^~~~
      | scanf
a.cc:6:10: error: 'o' was not declared in this scope
    6 | if (N%2==o) printf ("%d", N);
      |          ^
a.cc:8:8: error: 'o' was not declared in this scope
    8 | return o;
      |        ^
Language: C++

#include<stdio.h>

int main(int argc,char[] argv){
	int N;
	scanf("%d",&N);
	if(N%2==0){
		printf("%d",N);
	}else{
		printf("%d",N*2);
	}
}

Compiler output:
a.cc:3:26: error: expected ',' or '...' before 'argv'
    3 | int main(int argc,char[] argv){
      |                          ^~~~
a.cc:3:5: warning: second argument of 'int main(int, char*)' should be 'char **' [-Wmain]
    3 | int main(int argc,char[] argv){
      |     ^~~~
Language: C++

#include<stdio.h>
 
int main (void){
int N
scanf("%d",&N);
if (N%2==o) printf ("%d", N);
if (N%2==1) printf ("%d", N*2);
return o;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: expected initializer before 'scanf'
    5 | scanf("%d",&N);
      | ^~~~~
a.cc:6:5: error: 'N' was not declared in this scope
    6 | if (N%2==o) printf ("%d", N);
      |     ^
a.cc:6:10: error: 'o' was not declared in this scope
    6 | if (N%2==o) printf ("%d", N);
      |          ^
a.cc:7:5: error: 'N' was not declared in this scope
    7 | if (N%2==1) printf ("%d", N*2);
      |     ^
a.cc:8:8: error: 'o' was not declared in this scope
    8 | return o;
      |        ^
Language: C++

#include stdio

int main(){
if(N / 2 == 0){
return N;
}else{
return N*2;
}


}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include stdio
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:4:4: error: 'N' was not declared in this scope
    4 | if(N / 2 == 0){
      |    ^
Language: C

#include <studio.h>

int main(int argc, char *argv[]){
    int N;
    int answer;
    char buf[128];

    sscanf(buf, "%d", &N);

    if(N%2==1){
        return N*2;
    }
    return N;   
}


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

  1 #include <stdio.h>
  2 
  3 int main() {
  4     int n;
  5     scanf("%d", &n);
  6     if (n % 2 == 0) {
  7     ¦   printf("%d\n" , n);
  8     } else {
  9     ¦   printf("%d\n", 2 * n);
 10     }
 11     return 0;
 12 }


Compiler output:
main.c:1:3: error: expected identifier or '(' before numeric constant
    1 |   1 #include <stdio.h>
      |   ^
main.c:1:5: error: stray '#' in program
    1 |   1 #include <stdio.h>
      |     ^
main.c:7:9: error: stray '\302' in program
    7 |   7     <U+00A6>   printf("%d\n" , n);
      |         ^~~~~~~~
main.c:9:9: error: stray '\302' in program
    9 |   9     <U+00A6>   printf("%d\n", 2 * n);
      |         ^~~~~~~~
Language: C++

#include<stdio.h>

int main (void){
int N
scan("%d",&N);
if (N%2==o) printf ("%d", N);
if (N%2==1) printf ("%d", N*2);
return o;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: expected initializer before 'scan'
    5 | scan("%d",&N);
      | ^~~~
a.cc:6:5: error: 'N' was not declared in this scope
    6 | if (N%2==o) printf ("%d", N);
      |     ^
a.cc:6:10: error: 'o' was not declared in this scope
    6 | if (N%2==o) printf ("%d", N);
      |          ^
a.cc:7:5: error: 'N' was not declared in this scope
    7 | if (N%2==1) printf ("%d", N*2);
      |     ^
a.cc:8:8: error: 'o' was not declared in this scope
    8 | return o;
      |        ^
Language: C++

#include <stdio.h>

int main(void){

    int N;
    scan("%d), &N);
    if(N%2 == 1){
        printf("%d", N*2);
        else {
            printf("%d", N);
            return N;
        }
    }
}

Compiler output:
a.cc:6:10: warning: missing terminating " character
    6 |     scan("%d), &N);
      |          ^
a.cc:6:10: error: missing terminating " character
    6 |     scan("%d), &N);
      |          ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: expected primary-expression before 'if'
    7 |     if(N%2 == 1){
      |     ^~
Language: C++

#include <stdio.h>

int main(void){
int n;
scanf("%d", &n);
if(n%2){
printf("%d\n", n * 2);
}else{
prinf("%d\n", n);
}
return 0;
}

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

#include <stdio.h>

int main(void){
  int N;
  scanf("%d", &N);
  if(N%2==1)printf("%d\n", N*2);
  else printf("%d\n", N);
  return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
    8 |   return;
      |   ^~~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
int a;
cin >> a;
if (a % 2 == 1) a *= 2
cout << a << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: expected ';' before 'cout'
    8 | if (a % 2 == 1) a *= 2
      |                       ^
      |                       ;
    9 | cout << a << endl;
      | ~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n;
    int a[100];

    int mini, maxi;

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

    if (a[0] < a[1]){
        mini = a[0];
        maxi = a[1];
    }else{
        mini = a[1];
        maxi = a[0]
    }

    for(int i = 2; i < n; i++){
        if (a[i] < mini){
            mini = a[i];
        }
        if (a[i] > maxi){
            maxi = a[i];
        }
    }
    cout << maxi - mini;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: expected ';' before '}' token
   20 |         maxi = a[0]
      |                    ^
      |                    ;
   21 |     }
      |     ~
Language: C

#include <stdio.h>

int main() {

	long long int input;

	scanf("%lld", &input)

	if((input % 2) == 0) {
		printf("%lld\n", input);
	} else {
		printf("%lld\n", input * 2);
	}

	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:30: error: expected ';' before 'if'
    7 |         scanf("%lld", &input)
      |                              ^
      |                              ;
    8 | 
    9 |         if((input % 2) == 0) {
      |         ~~
Language: C++

#include <iostream>
using namespace std;
int main(){
int N;
  cin >> N;
  if(N % 2 = 0){
    cout << N << endl;
  }
  else{
    cout << N * 2 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: lvalue required as left operand of assignment
    6 |   if(N % 2 = 0){
      |      ~~^~~
Language: C++

#include<algorithm>
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<list>
#include<sstream>

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#inlcude <iostream>
using namespace std;

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

    if (n % 2 == 0) {
        cout << n << endl;
    } else {
        cout << n * 2 << endl;
    }

    return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude <iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude <iostream>
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout << n << endl;
      |         ^~~~
a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:22: error: 'endl' was not declared in this scope
   10 |         cout << n << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude <iostream>
a.cc:12:9: error: 'cout' was not declared in this scope
   12 |         cout << n * 2 << endl;
      |         ^~~~
a.cc:12:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:26: error: 'endl' was not declared in this scope
   12 |         cout << n * 2 << endl;
      |                          ^~~~
a.cc:12:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

import java.util.Scanner

  public class Main{
  public static void main (String[] args){

  Scanner scanner= new Scanner(System.in);
  int n =scanner.nextInt();

  if(n%2==0){
  System.out.println(n);
  }else{
  System.out.println(2*n);
  }

  }

  }
  

Compiler output:
Main.java:1: error: ';' expected
import java.util.Scanner
                        ^
1 error
Language: Java

import java.util.Scanner

  class Main{
  public static void main (String[] args){

  Scanner scanner= new Scanner(System.in);
  int n =scanner.nextInt();

  if(n%2==0){
  System.out.println(n);
  }else{
  System.out.println(2*n);
  }

  }

  }
  

Compiler output:
Main.java:1: error: ';' expected
import java.util.Scanner
                        ^
1 error
Language: Java

	import java.util.Scanner;

public class A_Multiple_of_2_and_N {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int answer;
        if (N % 2 == 0) {
            answer = N;
        } else {
            answer = N * 2;
        }

        System.out.println(answer);
    }
}


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

import java.util.Scanner;
public class main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
if(N%2==0){
System.out.println(N);
}else{
System.out.println(N*2);
}

}
}


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

import java.util.*;

public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
if(N%2==0){
System.out.println(N);
}else{
System.out.println(N*2);
}

}


Compiler output:
Main.java:3: 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

import java.util.*;

public static void main(String[] args){
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
if(N%2==0){
System.out.println(N);
}else{
System.out.println(N*2);
}

}


Compiler output:
Main.java:3: 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: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  if(N % 2 == 1){
  	N *= 2
  }
  cout << N << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected ';' before '}' token
    8 |         N *= 2
      |               ^
      |               ;
    9 |   }
      |   ~
Language: C

#include<stdio.h>

int main(void){
  int n;
  scanf("%d",&n);
  while(1){
    if((i%n==0) && (i%2==0)){
         printf("%d\n",i);
         break;
    }
    else
      i++;
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:9: error: 'i' undeclared (first use in this function)
    7 |     if((i%n==0) && (i%2==0)){
      |         ^
main.c:7:9: 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,t;
cin>>n;
t=n;
int f=99;
while (f=1)
{
if(t % 2=0 && t % n=0)
{
cout<<t;
break;
}
t=t+n;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: lvalue required as left operand of assignment
   11 | if(t % 2=0 && t % n=0)
      |          ~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,t;
int i;
cin>>n;
t=n;
int f=0;
while (f=1)
{
if(t % 2=0 && t % n=0)
{
cout<<t;
break;
}
t=t+n;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: lvalue required as left operand of assignment
   12 | if(t % 2=0 && t % n=0)
      |          ~~^~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999

using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };






int main() {
  ll N;
  cin>>N;
  while(true){
    int a=0;
    a++;
   {
  cout<<N;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:38:14: note: to match this '{'
   38 |   while(true){
      |              ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:35:12: note: to match this '{'
   35 | int main() {
      |            ^
Language: C++

#include <iostream>

using namespace std;

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

    if (n % 2 == 0) {
        count << n << endl;
    } else {
        cout << n * 2 << endl;
    }

    return 0;
}

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

//乗算
#include<iostream>
using namespace std;
int multi(int N){
	int a;
	a=2*N;
	return a;
}
int main(){
	int N,a;
	cout<<"Nの値を入力してくださいしてください"<<endl;
	cout<<"N="<<endl;
	cin>>N;
	if(N<0 || N>1000000000){
		cout<<N<<endl;
	}
	if(N%2==0){
		cout<<<<N<<endl;
	}else{
		a=multi(N);
		cout<<a<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: expected primary-expression before '<<' token
   18 |                 cout<<<<N<<endl;
      |                       ^~
Language: C++

include<stdio.h>

int main(){
	long long N;
    scanf("%d",&N);
    
    if(N%2==1){
    	N=N*2;
    }
    
    printf("%lld",N);
    
    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>

int main(void){
    using namespace std;
    int a;

    cin >> a;

    double a_l[a];
    double b_l[a];

    double num = 0;
    double mean = 0;

    double sum = 0;

    for(int i=0; i < a; i++){
        cin >> a_l[i];
        b_l[i] = a_l[i]-(i+1);
    }

    sort(b_l, b_l+a);

    if(a % 2 == 0){
        mean = (b_l[a/2-1] + b_l[a/2])/2;
        mean += 1
    }else{
        mean = b_l[a/2];
    }

    for(int i=0; i<a; i++){
        num = a_l[i] - (mean + i+1);
        if(num < 0){
            num *= -1;
        }
        sum += num;
    }

    cout << sum << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected ';' before '}' token
   29 |         mean += 1
      |                  ^
      |                  ;
   30 |     }else{
      |     ~
Language: C++

#include <bits/stdc++.h>
int main(){
    int N;
    cin >> N;
    if(N%2==0){
        cout << N << endl;
    }
    else{
        cout << N*2 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin >> N;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         cout << N << 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:6:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         cout << N << 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)
      |     ^~~~
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |         cout << N*2 << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |         cout << N*2 << endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int mani(){
  int n;
  cin >> n;
  if(n % 2 == 0)cout << n << endl;
  else cout << n*2 << endl;
  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;

int main(){
  
  int n;
  
  cin >> n;
  
  if(n % 2) cout << 2 * n * __gcd(2, n) << endl;
  else cout << n << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: '__gcd' was not declared in this scope
   10 |   if(n % 2) cout << 2 * n * __gcd(2, n) << endl;
      |                             ^~~~~
Language: C++

#include <iostream>
#include <ctype.h>

int main() {
    unsigned int num;
    unsigned int output;

    std::cin >> num;

    if((num > pow(10,9))  && num < 1){
        exit(0);
    }

    if((num % 2) == 0){
        output =  num;
    }else{
        output =  num * 2;
    }

    std::cout << output << std::endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'pow' was not declared in this scope
   10 |     if((num > pow(10,9))  && num < 1){
      |               ^~~
Language: C++

#include <iostream>

int main() {
    unsigned int num;
    unsigned int output;

    std::cin >> num;

    if((num > pow(10,9))  && num < 1){
        exit(0);
    }

    if((num % 2) == 0){
        output =  num;
    }else{
        output =  num * 2;
    }

    std::cout << output << std::endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'pow' was not declared in this scope
    9 |     if((num > pow(10,9))  && num < 1){
      |               ^~~
Language: C++

#include <iostream>

int main() {
    unsigned int num;

    std::cin >> num;

    if((num > pow(10,9))  && num < 1){
        exit(0);
    }

    if((num % 2) == 0){
        return num;
    }else{
        return num * 2;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'pow' was not declared in this scope
    8 |     if((num > pow(10,9))  && num < 1){
      |               ^~~
Language: C++

#include <iostream>

int main() {
    unsigned int num;

    std::cin >> num;

    if(num > pow(10,9)){
        exit(0);
    }

    if((num % 2) == 0){
        return num;
    }else{
        return num * 2;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'pow' was not declared in this scope
    8 |     if(num > pow(10,9)){
      |              ^~~
Language: C++

#include<stdio.h>

int main(void)
{

	int a,i;
	
	scanf("%d",&a);

	for(i=2;i<=100000000;i=i+2;)
	{
	
		if(i%2==0&&i%a==0){
		
			break;
		
		}
	
	}
	
	printf("i",i);
	
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: expected ')' before ';' token
   10 |         for(i=2;i<=100000000;i=i+2;)
      |            ~                      ^
      |                                   )
a.cc:10:36: error: expected primary-expression before ')' token
   10 |         for(i=2;i<=100000000;i=i+2;)
      |                                    ^
Language: C

#include<stdio.h>

int main(void)
{
   int n,i;

   scanf("%d",&n);

   i = n;
   while(1){
     if(i%n==0)
       if(i%2==0)
         break;
     i++;
   }

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

   return 0;
}
~                   

Compiler output:
main.c:21:1: error: expected identifier or '(' before '~' token
   21 | ~
      | ^
Language: Java

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
      	System.out.println((a%2==0)?a:a*2);
    }
}

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

import java.util.Scanner;

public class Main {
  public static void main(String ...args) {
    final Scanner scanner = new Scanner(System.in);
    final int num = scanner.nextInt();
    final int result = multipleOf2and(num);
    System.out.println(result);
  }

  private static int multipleOf2and(final int num) {
	return (num % 2 == 0) ? num : num * i;
  }
}

Compiler output:
Main.java:12: error: cannot find symbol
	return (num % 2 == 0) ? num : num * i;
	                                    ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

mport java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    final int num = scanner.nextInt();
    final int result = multipleOf2and(num);
    System.out.println(result);
  }

  private static int multipleOf2and(final int num) {
	return (num % 2 == 0) ? num : num * i;
  }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;

public class C {
  public static void main(String ...args) {
    final Scanner scanner = new Scanner(System.in);
    final int length = scanner.nextInt();
    final int[] numbers = new int[length];
    for (int idx = 0; idx < length; idx++) {
      numbers[idx] = scanner.nextInt();
    }

    final int result = linearApproximation(length, numbers);
    System.out.println(result);
  }

  public static int linearApproximation(final int N, final int[] A) {
    final int b = 0;
    int acc = 0;
    for (int n = 1; n <= N; n++) {
      acc += Math.abs(A[n - 1] + (b - n));
    }

    return acc;
  }
}


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

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

int N

int main(){
  if(N%2 == 0){
    cout<< N << endl;
  }else{
    cout<< 2*N <<endl;
  }
  return 0;
}

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

# include<iostream>
using name space std;
int main()
{
	int N;
	cin>>N;
	
	int ans = N%2==0?N:2*N;
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'name'
    2 | using name space std;
      |       ^~~~
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>>N;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |         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:9:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |         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() {
	long long n;
	cin>>n;
	cout<<n*2/__gcd(n, 2)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: no matching function for call to '__gcd(long long int&, int)'
    6 |         cout<<n*2/__gcd(n, 2)<<endl;
      |                   ~~~~~^~~~~~
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:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:6:24: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
    6 |         cout<<n*2/__gcd(n, 2)<<endl;
      |                   ~~~~~^~~~~~
Language: Java

import java.util.*;

public class NewNotesPage{
  
  public static void main(String[] args) {
	// TODO Auto-generated method stub
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if (n%2==0){
    	System.out.println(n);
    } else {
    	System.out.println(n*2);
    }
    
  }
}

Compiler output:
Main.java:3: error: class NewNotesPage is public, should be declared in a file named NewNotesPage.java
public class NewNotesPage{
       ^
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. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int[] a=new int[t];
		for(int i=0;i<t;i++){
			a[i]=in.nextInt();
		}
		Arrays.sort(a);
		System.out.println(Math.abs(a[0])-a[a.length-1]);
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
		int[] a=new int[t];
		                ^
  symbol:   variable t
  location: class Main
Main.java:15: error: cannot find symbol
		for(int i=0;i<t;i++){
		              ^
  symbol:   variable t
  location: class Main
2 errors
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 in=new Scenner(System.in);
		int n=in.nextInt();
		long t=2;
		System.out.println(t*n);
	}
}

Compiler output:
Main.java:12: error: cannot find symbol
		Scanner in=new Scenner(System.in);
		               ^
  symbol:   class Scenner
  location: class Ideone
1 error
Language: C++


#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define WHL(i) while(i)
#define putn printf("\n")
#define scanf scanf_s
using namespace std;


int main ()
{
	int tmp;
	scanf ("%d", &tmp);

	if (!(tmp % 2)) {
		printf ("%d\n", tmp);
	}
	else {
		printf ("%d\n", tmp * 2);
	}
}


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

#ifdef __GNUC__
#include <bits/stdc++.h>
#else
#include "bits/stdc++.h"
#endif
#define REP(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define WHL(i) while(i)
#define putn printf("\n")
#define scanf scanf_s
using namespace std;


int main ()
{
	int tmp;
	scanf ("%d", &tmp);
	if (tmp % 2)printf ("%d\n", tmp);
	else printf ("%d\n", tmp * 2);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 | #define scanf scanf_s
      |               ^~~~~~~
a.cc:17:9: note: in expansion of macro 'scanf'
   17 |         scanf ("%d", &tmp);
      |         ^~~~~
Language: C

#include <stdio.h>
 
int main() {
	int a;
	scanf_s("%d", &a);
		if(a % 2 == 1){
			printf("%d", 2 * a);
		}
 
		else {
			printf("%d", a);
		}
		return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &a);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio.h>

int main() {
	int a;
	scanf_s("%d", &a);
		if(a % 2 == 1){
			printf("%d", 2 * a);
		}

		else {
			printf("%d", a);
		}
		return 0;

}

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

#include<iostream>

using namespace std;

int main()
{
int n;
  cin >> n;
  
  if(n % 2 == 0)
  {
	cout << n;
    else{
      cout << 2 * n;
    }
  }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected '}' before 'else'
   13 |     else{
      |     ^~~~
a.cc:11:3: note: to match this '{'
   11 |   {
      |   ^
a.cc: At global scope:
a.cc:17:5: error: expected unqualified-id before 'return'
   17 |     return 0;
      |     ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int i;
  cin >> i;
  if (i % 2 == 0) {
    cout << i << endl;
    else {
      cout << 2 * i << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected '}' before 'else'
    9 |     else {
      |     ^~~~
a.cc:7:19: note: to match this '{'
    7 |   if (i % 2 == 0) {
      |                   ^
a.cc: At global scope:
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int findMinInteger () {
  int i;
  cin >> i;
  switch (i % 2) {
    case 0:
      return i;
    case 1:
      return i + i;
    default:
      break;
  }
}

Compiler output:
a.cc: In function 'int findMinInteger()':
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int findMinInteger() {
  int i;
  cin >> i;
  switch (i % 2) {
    case 1: return 2 * i;
    case 0: return i;
    default: break
  }
}

Compiler output:
a.cc: In function 'int findMinInteger()':
a.cc:10:19: error: expected ';' before '}' token
   10 |     default: break
      |                   ^
      |                   ;
   11 |   }
      |   ~                
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C++

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

int a;

ine main(){
   scanf("%d", &a);

  if(a % 2 == 0)
     printf("%d", a);
  else
     printf("%d", a*2);

  return 0;
}

Compiler output:
a.cc:6:1: error: 'ine' does not name a type; did you mean 'int'?
    6 | ine main(){
      | ^~~
      | int
Language: Java

import java.util.*;

public class HelloWorld
{
  public static void main(String[] args)
  {
	Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
	int i = n;
    while (i % 2 != 0) {
      i += n;
    }
    System.out.println(i);
  }
}


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

#include <bits/stdc++.h>
#define re return
#define ll long long
#define ull unsigned ll
#define ld long double
#define f first
#define s second
#define pi acos(-1)
#define oo (ll)1e9
#define OO (ll)1e18
#define EPS 1e-7
#define FX(n) fixed<<setprecision(n)
#define mm(o,k) memset(o,k,sizeof o)
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int maxn=200005;

int main()
{
    IO;
    ll n;
    cin >> n;
    cout<<2*n/__gcd(2,n)<<endl;
    re 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: no matching function for call to '__gcd(int, long long int&)'
   23 |     cout<<2*n/__gcd(2,n)<<endl;
      |               ~~~~~^~~~~
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:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:23:20: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
   23 |     cout<<2*n/__gcd(2,n)<<endl;
      |               ~~~~~^~~~~
Language: C++


function Main(input) {

	input = input.split("\n");

	var n = parseInt(input[0], 10);

	if (n & 1)
	{
		console.log('%d',n*2);
	}
	else
	{
		console.log('%d',n);
	}

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Compiler output:
a.cc:10:29: warning: multi-character character constant [-Wmultichar]
   10 |                 console.log('%d',n*2);
      |                             ^~~~
a.cc:14:29: warning: multi-character character constant [-Wmultichar]
   14 |                 console.log('%d',n);
      |                             ^~~~
a.cc:2:1: error: 'function' does not name a type; did you mean 'union'?
    2 | function Main(input) {
      | ^~~~~~~~
      | union
a.cc:19:5: error: expected constructor, destructor, or type conversion before '(' token
   19 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
Language: C++

#include<math.h>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<math.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<long long> a(n);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<math.h>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'long'
    7 |         vector<long long> a(n);
      |                ^~~~
a.cc:9:24: error: 'a' was not declared in this scope
    9 |                 cin >> a[i];
      |                        ^
a.cc:11:14: error: 'a' was not declared in this scope
   11 |         sort(a.begin(), a.end());
      |              ^
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   11 |         sort(a.begin(), a.end());
      |         ^~~~
      |         sqrt
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << x << endl;
      |         ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:22: error: 'endl' was not declared in this scope
   13 |         cout << x << endl;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<math.h>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
int main (){
    int n,;
    cin>>n;
    m=n*2;
    if(n%2==0){
        cout<<n<<endl;
    }else{
        cout<<n*2<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: expected unqualified-id before ';' token
    4 |     int n,;
      |           ^
a.cc:6:5: error: 'm' was not declared in this scope
    6 |     m=n*2;
      |     ^
Language: Java

import java.util.*;
 
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner();
        int n = Integer.parseInt(sc.next());
        System.out.println(n % 2 != 0 ? n * 2 : n);
    }
}

Compiler output:
Main.java:5: error: no suitable constructor found for Scanner(no arguments)
    	Scanner sc = new Scanner();
    	             ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: Java

import java.util.*

public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner();
        int n = Integer.parseInt(sc.next());
        System.out.println(n % 2 != 0 ? n * 2 : n);
    }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util.*
                  ^
1 error
Language: C++

//{{{
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop,~))(__VA_ARGS__)
#define loop(n) rep2(_loop_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define repN(a) repX a
#define repX(a0,a1,a2,x,...) x
const int MOD = 1e9+7;
//}}}

int main(){
	int N;
	cin >> N;
	if(N%2) N*=2;
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

#include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
	int n;
	cin >> n;
	if n%2 == 0 {
		cout << n << endl;
	}else {
		cout << n*2 << endl;
	}
	return 0
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:6:12: error: expected '(' before 'n'
    6 |         if n%2 == 0 {
      |            ^
      |            (
a.cc:8:10: error: 'else' without a previous 'if'
    8 |         }else {
      |          ^~~~
a.cc:11:17: error: expected ';' before '}' token
   11 |         return 0
      |                 ^
      |                 ;
   12 | }
      | ~
Language: C++

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

Compiler output:
a.cc:3:11: error: 'n' was not declared in this scope
    3 | int check(n){
      |           ^
a.cc: In function 'int main()':
a.cc:10:22: error: 'check' cannot be used as a function
   10 |   printf("%d\n",check(n));
      |                 ~~~~~^~~
Language: Java

import java.util.*;
import java.io.*;
class Main{
   public static void main(String[] args){
     Scanner in=new Scanner(System.in);
     int n=in.nextInt();
    long answer=0;
    if((n&1)==1){
     answer=n<<1;
    }else
     answer=n;
     out.write(answer+"");
}
}

Compiler output:
Main.java:12: error: cannot find symbol
     out.write(answer+"");
     ^
  symbol:   variable out
  location: class Main
1 error
Language: Java

//CREATED BY : AMBIKESH JHA
//NEPAL
//Never Give Up Trying...


/*starting import statements*/
import java.io.*;
import java.util.*;
import java.math.*;
/*ending import statements*/

//Code Begins Here
public class Temp{
    static final BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static final BufferedWriter out=new BufferedWriter(new OutputStreamWriter(System.out));
    static int tc;
    static String[] s;
    /*define methods here*/
     public static int[] parseArray(String[] s){
       int[] array=new int[s.length];
       for(int i=0;i<array.length;i++){
         array[i]=Integer.parseInt(s[i]);
       }
       return array;
     }
    /*end methods here*/

        public static void main(String[] args)throws IOException{
        //long start=System.nanoTime();
        tc=1;
        //tc=Integer.parseInt(br.readLine());
        t:
        while(tc-->0){
          long answer=0;
          int n=Integer.parseInt(br.readLine());
          if((n&1)==0){
            answer=n;
           out.write(answer+"");}
          else{
            answer=(n<<1);
           out.write(answer+"");}
        //out.write("\nTime elapsed = "+(System.nanoTime()-start)+ " nanoSec.\n");
        out.close();
      }
    }
}
/*define class here*/

/*end class here*/


Compiler output:
Main.java:13: error: class Temp is public, should be declared in a file named Temp.java
public class Temp{
       ^
1 error