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

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    void solve() {
        input();
        int N;
        cin >> N;
        int ans = N * (1 + N % 2);
        cout << N << endl;
    }
};

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 <bits/stdc++.h>
using namespace std;

int gcd(int n, int m) {
    int r;

    while(m % n != 0) {
        r = m;
		m = n % m;
		n = r;
    }

    return n;
}

int main() {
    int n, m = 2;

    cin >> n;

    cout << m * n / gcd(m, n);

    return 0;
}

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

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

int main() {
  int32_t n;
  int32_t value;
  int32_t max = 0;
  int32_t min = INT_MAX;

  cin >> n;
  for (int32_t i = 0; i < n; ++i) {
    cin >> value;
    max = std::max(max, value);
    min = std::min(min, value);
  }
  cout << max - min;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'INT_MAX' was not declared in this scope
    9 |   int32_t min = INT_MAX;
      |                 ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | #include <string>
Language: C++

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

int main() {
  int n;
  cin >> n;
  cout << (n % 2) ? n * 2 : n << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   cout << (n % 2) ? n * 2 : n << endl;
      |                             ~~^~~~~~~
Language: C++

#include <stdio.h>

int main(int argc, char *argv[]) {
  int n = atoi( argv[1] );
  return (n % 2) ? n * 2 : n;  
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:4:11: error: 'atoi' was not declared in this scope
    4 |   int n = atoi( argv[1] );
      |           ^~~~
Language: C++

int main(int argc, char *argv[]) {
  int n = atoi( argv[1] );
  return (n % 2) ? n * 2 : n;  
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:2:11: error: 'atoi' was not declared in this scope
    2 |   int n = atoi( argv[1] );
      |           ^~~~
Language: C++

int main(int32_t n) {
  return (n % 2) ? n * 2 : n;  
}

Compiler output:
a.cc:1:5: error: cannot declare '::main' to be a global variable
    1 | int main(int32_t n) {
      |     ^~~~
a.cc:1:10: error: 'int32_t' was not declared in this scope
    1 | int main(int32_t n) {
      |          ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | int main(int32_t n) {
Language: C++

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

Compiler output:
a.cc:5:3: error: expected initializer before 'int'
    5 |   int N;
      |   ^~~
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin>>N;
      |   ^~~
a.cc:7:5: error: expected unqualified-id before 'if'
    7 |     if(N%2==0 || N==1) cout<<N;
      |     ^~
a.cc:8:5: error: expected unqualified-id before 'else'
    8 |     else cout<<2*N;
      |     ^~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
Language: C++

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

int main() {
  int n;
  cin >>n ;
  for(int i=1;i<1ooooooooo;i++){
  if (i%2==0&&i%n==0) {
    cout <<i<< endl;
    break;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: unable to find numeric literal operator 'operator""ooooooooo'
    7 |   for(int i=1;i<1ooooooooo;i++){
      |                 ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
  ll n ;
  cin >> n ;
  vector<ll> v(n);
  rep(i, n) {  cin >> v[i] ;}
  sort(v.begin(), v.end());
  cout << v[v.size() - 1] - v[0] << endl;
}
}


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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
  ll n ;
  cin >> n ;
  vector<ll> v(n);
  rep(i, n) {  cin >> v[i] ;}
  sort(v.begin(), v.end());
  cout << v[v.size - 1] - v[0] << endl;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   23 |   cout << v[v.size - 1] - v[0] << endl;
      |             ~~^~~~
      |                   ()
a.cc: At global scope:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cctype>
#include <queue>
#include <map>
#include <set> 
#include <bitset>
#include <cmath>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)

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


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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: expected ';' before 'endl'
   25 |         cout << 1 endl;
      |                  ^~~~~
      |                  ;
Language: C++

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

int main() {
	int N;
  	cin >> N;
  
  	for(int i = 0; i < 1000000000; i++;) {
    	if(i % 2 == 0 && i % N == 0) {
        	cout << i << endl;
          	break;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:43: error: expected ')' before ';' token
    8 |         for(int i = 0; i < 1000000000; i++;) {
      |            ~                              ^
      |                                           )
a.cc:8:44: error: expected primary-expression before ')' token
    8 |         for(int i = 0; i < 1000000000; i++;) {
      |                                            ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a;
  cin>>a;
  if(a%2>0)a+=a
  cout<<a;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before 'cout'
    7 |   if(a%2>0)a+=a
      |                ^
      |                ;
    8 |   cout<<a;
      |   ~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<int> A(N);
  int min=1000000000,max=1;
  for(int i;i<N;i++){
    cin>> A.at(i);
    if(A.at(i)<min){
      min =A.at(i);
    }
    if(A.at(i)>max){
      max =A.at(i);
    }
  }
  cout << max-min <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:10:11: error: 'A' was not declared in this scope
   10 |     cin>> A.at(i);
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin>>N;
  vector<int> A(N);
  int min=1000000000,max=1;

  for(int i;i<N;i++){
    cin>> A.at(i);
    if(A.at(i)<min){
      min =A.at(i);
    }
    if(A.at(i)>max){
      max =A.at(i);
    }
  }
  cout << max-min <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:11:11: error: 'A' was not declared in this scope
   11 |     cin>> A.at(i);
      |           ^
Language: C

#include <stdio.h>

int main(){
	double a;
  scanf("%lf",&a);
  if(a%2==0) printf("%f\n",a);
  else printf("%f\n",a);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: invalid operands to binary % (have 'double' and 'int')
    6 |   if(a%2==0) printf("%f\n",a);
      |       ^
Language: C++

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

    


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | z#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'z' does not name a type
    1 | z#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> N;
      |   ^~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << ans << endl;
      |   ^~~~
a.cc:13:18: error: 'endl' was not declared in this scope
   13 |   cout << ans << endl;
      |                  ^~~~
Language: C

#include<stdio.h>
int main(void){
  int N,i,j;
  int A[100]={0};
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<N-1;i++){
    for(j=i+1;j<N;j++){
      if(x<y){
    	int t=x;
    	x=y;
    	y=t;
  		}
    }
  }
  printf("%d\n",A[0]-A[N-1]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:10: error: 'x' undeclared (first use in this function)
   11 |       if(x<y){
      |          ^
main.c:11:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:12: error: 'y' undeclared (first use in this function)
   11 |       if(x<y){
      |            ^
Language: C++

#include <bits/stc++.h>
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:1:10: fatal error: bits/stc++.h: No such file or directory
    1 | #include <bits/stc++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:6:9: error: lvalue required as left operand of assignment
    6 |   if(n%2=0){
      |         ^
Language: C

#include <stdio.h>

int main(){
    int n,ans;
    scanf("%d",&n);
    
    ans=2*n;
    if(n%2==0){
        while(g%2==0){
            ans/=2;
        }   
    }   
    return 0;
}  

Compiler output:
main.c: In function 'main':
main.c:9:15: error: 'g' undeclared (first use in this function)
    9 |         while(g%2==0){
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
    int A,B,C;
    scanf("%d",&A);

if(N%2==0){
    printf("%d",N);
}else{
    printf("%d",N*2);
}
    
    return 0;
}

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

using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

long N;
inline void solve(){
  IN(N);
  OUT((N*2/__gcd(N,2)));
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:17: error: no matching function for call to '__gcd(long int&, int)'
   31 |   OUT((N*2/__gcd(N,2)));
      |            ~~~~~^~~~~
a.cc:15:23: note: in definition of macro 'OUT'
   15 | #define OUT(P) cout<<(P)<<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:2:
/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:31:17: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long int' and 'int')
   31 |   OUT((N*2/__gcd(N,2)));
      |            ~~~~~^~~~~
a.cc:15:23: note: in definition of macro 'OUT'
   15 | #define OUT(P) cout<<(P)<<endl
      |                       ^
Language: C++

using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

long N;
inline void solve(){
  IN(N);
  OUT(N*2/__gcd(N,2));
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:31:16: error: no matching function for call to '__gcd(long int&, int)'
   31 |   OUT(N*2/__gcd(N,2));
      |           ~~~~~^~~~~
a.cc:15:23: note: in definition of macro 'OUT'
   15 | #define OUT(P) cout<<(P)<<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:2:
/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:31:16: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long int' and 'int')
   31 |   OUT(N*2/__gcd(N,2));
      |           ~~~~~^~~~~
a.cc:15:23: note: in definition of macro 'OUT'
   15 | #define OUT(P) cout<<(P)<<endl
      |                       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before '}' token
    7 |   else cout<<n*2
      |                 ^
      |                 ;
    8 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
#include <functional>
#include <numeric>
#include <stack>
#include <tuple>

using namespace std;
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
const int INF = 100000000;
const long long LINF = 1000000000000000000;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-6;
using pii = std::pair<int, int>;
using pLL = std::pair<long long, long long>;
using ll = long long;
#define SORT(v) std::sort(v.begin(), v.end())

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b;
	cin >> a;
	if (a % 2 == 0) cout << a << endl;
	else cout << a * 2 << endl;
	return 0;


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 's' was not declared in this scope
    8 |   else cout << s*N << endl;
      |                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:38: error: 'n' was not declared in this scope
    5 |   if(a%2==0)cout<<a<<endl;else cout<<n*2<<endl;}
      |                                      ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:5:17: error: 'cout' was not declared in this scope
    5 |                 cout << N;
      |                 ^~~~
a.cc:7:17: error: 'cout' was not declared in this scope
    7 |                 cout << N * 2;
      |                 ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <string>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: unable to find numeric literal operator 'operator""N'
   14 |     cout << 2N << endl;
      |             ^~
Language: C++

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

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

#include <iostream>
using namespace std;

int main(){
     int N,M;
    cin >> N;
    if (N/2=0) M=N;
    else M=2*N;
    cout << M << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: lvalue required as left operand of assignment
    7 |     if (N/2=0) M=N;
      |         ~^~
Language: C++

// by syu
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var in = NewScanner(os.Stdin, 0)

func main() {
	N := in.Int()
	if N&1 != 0 {
		Pln(N * 2)
	} else {
		Pln(N)
	}
}

type Scanner struct {
	*bufio.Scanner
}

func NewScanner(r io.Reader, max int) *Scanner {
	s := bufio.NewScanner(r)
	s.Split(scanWords)
	if max <= 0 {
		max = 1048576
	}
	s.Buffer([]byte{}, max)
	return &Scanner{s}
}
func (s *Scanner) Int() int {
	s.Scan()
	i, e := strconv.ParseInt(s.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return int(i)
}
func isSpace(b byte) bool {
	return b == ' ' || b == '\n' || b == '\r' || b == '\t'
}
func scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
	start := 0
	for start < len(data) && isSpace(data[start]) {
		start++
	}
	for i := start; i < len(data); i++ {
		if isSpace(data[i]) {
			return i + 1, data[start:i], nil
		}
	}
	if atEOF && len(data) > start {
		return len(data), data[start:], nil
	}
	return start, nil, nil
}
func Pln(s ...interface{}) {
	fmt.Println(s...)
}


Compiler output:
a.cc:2:1: error: 'package' does not name a type
    2 | package main
      | ^~~~~~~
a.cc:23:1: error: 'type' does not name a type; did you mean 'typeof'?
   23 | type Scanner struct {
      | ^~~~
      | typeof
a.cc:27:1: error: 'func' does not name a type
   27 | func NewScanner(r io.Reader, max int) *Scanner {
      | ^~~~
a.cc:36:6: error: expected constructor, destructor, or type conversion before '(' token
   36 | func (s *Scanner) Int() int {
      |      ^
a.cc:44:1: error: 'func' does not name a type
   44 | func isSpace(b byte) bool {
      | ^~~~
a.cc:47:1: error: 'func' does not name a type
   47 | func scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {
      | ^~~~
a.cc:62:1: error: 'func' does not name a type
   62 | func Pln(s ...interface{}) {
      | ^~~~
a.cc:62:26: error: expected unqualified-id before ')' token
   62 | func Pln(s ...interface{}) {
      |                          ^
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

// 整数スキャン（複数）
/*
int x;
scanf("%d",&x);
int y;
scanf("%d",&y);
int z;
scanf("%d",&y);

// n個の整数のスキャン
/*
ll a[n] = {};
rep(i,n){
    scanf("%lld",&a[i]);
}
*/

// 文字列スキャン
/*
string s;
cin >> s;
*/


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

    if(n%2==0){
        ans=n;
    }else{
        ans=n*2;
    }


    ll ans = 0;

    cout << ans << endl;
   
    return 0;
}
 
 


Compiler output:
a.cc: In function 'int main()':
a.cc:83:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   83 |         ans=n;
      |         ^~~
      |         abs
a.cc:85:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   85 |         ans=n*2;
      |         ^~~
      |         abs
Language: C++

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

int main() {
  int n;
  cin >>n;
  
  for (int i=1;1<=10**9;++i){
    if (i%2==0 && i%n==0){
      cout <<i;
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: invalid type argument of unary '*' (have 'int')
    8 |   for (int i=1;1<=10**9;++i){
      |                      ^~
Language: C++

#include<iostream>
using namespace std;

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

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

int min=a[0],max=a[0];
for(int i = 1;i<a;i++){
if(max>a[i]){
max=a[i];
}
if(min<a[i]){
min=a[i];
}
}
cout << max-min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'vector' was not declared in this scope
    8 | vector<int> a(N);
      | ^~~~~~
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:8:8: error: expected primary-expression before 'int'
    8 | vector<int> a(N);
      |        ^~~
a.cc:9:16: error: 'a' was not declared in this scope
    9 | for(int i =0;i<a;i++)
      |                ^
a.cc:12:9: error: 'a' was not declared in this scope
   12 | int min=a[0],max=a[0];
      |         ^
a.cc:21:12: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   21 | cout << max-min << endl;
      |         ~~~^~~~
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: unable to find numeric literal operator 'operator""N'
   11 | cout << 2N << endl;
      |         ^~
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
      
      
      System.out.print(a*2)
    }
}

Compiler output:
Main.java:9: error: ';' expected
      System.out.print(a*2)
                           ^
1 error
Language: C++

#include "iostream"

using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 1000;
typedef long long ll;
ll s[maxn];

int main() {
    int n;
    //cin >> n;
    scanf("%d", &n);
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        scanf("%lld", &s[i]);
        s[i] = s[i]-i;
    }
    sort(s,s+n);
    sum = s[n/2];
    ll ans = 0;
    //cout<<sum<<endl;
    //ll ans2 = 0;
    for (int i = 0; i < n; i++) {
        ans = ans + abs(s[i] - sum);
        //ans2 = ans2+abs(s[i]-sum-i-1);
    }
    //cout<<s[1]<<endl;
    //cout<<sum<<endl;
    printf("%lld\n",ans);
    return 0;
}


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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] numlist = new int[N];
    
    for(int i=0;i<N;i++){
      numlist[i]=sc.nextInt();
    }
    Arrays.sort(numlist);
    
    int diff=numlist[N-1]-numlist[0];
    
    System.out.println(diff);
  }
}

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
Main.java:10: error: cannot find symbol
    Arrays.sort(numlist);
    ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: Java

拡げる
Copy
Copy
import java.util.*;
 
public class Main{
  
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
 
    int min=1;
    int max=10000000000;
    
    for(int i=0; i < N; i++){
      int A = sc.nextInt();
      min = Math.min(min, A);
      max = Math.max(max, A);
     
    }
    System.out.println(Math.abs(max-min));
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
???
^
Main.java:14: error: integer number too large
    int max=10000000000;
            ^
2 errors
Language: Java

import java.util.*;

public class Main{
  
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();

    int min=1;
    int max=100000000;
    
    for(int i ; i < N; i++){
      int A = sc.nextInt();
      min = Math.min(min, A);
      max = Math.max(max, A);
     
    }
    System.out.println(Math.abs(max-min));
  }
}

Compiler output:
Main.java:13: error: variable i might not have been initialized
    for(int i ; i < N; i++){
                ^
1 error
Language: Java

import java.util.*;

public class Main{
  
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();

    int min=1;
    int max=100000000;
    
    for(int i ; i < N; i++){
      int A = sc.nextInt();
      min = Math.min(min, A);
      max = Math.max(max, A);
     
    }
    System.out.println(abs(max-min));
  }
}

Compiler output:
Main.java:19: error: cannot find symbol
    System.out.println(abs(max-min));
                       ^
  symbol:   method abs(int)
  location: class Main
1 error
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:5:15: error: expected expression before ')' token
    5 |   if("n%2==0",){
      |               ^
Language: C++

#include<iostream>
using namespace std;

最大公約数、２は素数ゆえ偶奇分岐で必要十分
int main(){
  int n;
  cin>>n;
  if(n%2==0)cout<<n;
  else cout<<n*2;
  return 0;
}


Compiler output:
a.cc:4:1: error: extended character 、 is not valid in an identifier
    4 | 最大公約数、２は素数ゆえ偶奇分岐で必要十分
      | ^
a.cc:4:1: error: '\U00006700\U00005927\U0000516c\U00007d04\U00006570\U00003001\U0000ff12\U0000306f\U00007d20\U00006570\U00003086\U00003048\U00005076\U00005947\U00005206\U00005c90\U00003067\U00005fc5\U00008981\U00005341\U00005206' does not name a type
    4 | 最大公約数、２は素数ゆえ偶奇分岐で必要十分
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<stdio.h>

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

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

#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<map>
using namespace std;
#define ll long long
int main(){
    int A,B;
    cin >> N;
    if(N%2==0){
      cout << N;
    }else{
      cout << N*2;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'N' was not declared in this scope
   10 |     cin >> N;
      |            ^
Language: C++

##include <bits/stdc++.h>;
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:1:1: error: stray '##' in program
    1 | ##include <bits/stdc++.h>;
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##include <bits/stdc++.h>;
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | ##include <bits/stdc++.h>;
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << n << endl;
      |     ^~~~
a.cc:9:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:18: error: 'endl' was not declared in this scope
    9 |     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 | ##include <bits/stdc++.h>;
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout << n * 2 << endl;
      |     ^~~~
a.cc:11:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |     cout << n * 2 << endl;
      |                      ^~~~
a.cc:11:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

##include <bits/stdc++.h>
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:1:1: error: stray '##' in program
    1 | ##include <bits/stdc++.h>
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##include <bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << n << endl;
      |     ^~~~
a.cc:9:18: error: 'endl' was not declared in this scope
    9 |     cout << n << endl;
      |                  ^~~~
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout << n * 2 << endl;
      |     ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |     cout << n * 2 << endl;
      |                      ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:6: error: 'N' was not declared in this scope
    2 |   if(N%2==0)return N;
      |      ^
a.cc:3:10: error: 'N' was not declared in this scope
    3 |   return N*2;
      |          ^
Language: C++

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

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

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

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

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

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

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

Compiler output:
main.c:1:2: error: invalid preprocessing directive #nclude; did you mean #include?
    1 | #nclude <stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf ("%d",&a);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #nclude <stdio.h>
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf ("%d",&a);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:2: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |  printf ("%d",b);
      |  ^~~~~~
main.c:11:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:2: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:2: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        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:12: error: reached end of file while parsing
}
 ^
1 error
Language: C

#include <stdio.h>
int main()
{
    int N;
    scanf("%d",&N);

    if(N%2=0){
        printf("%d",N);
    }else{
        printf("%d",2*N);
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:11: error: lvalue required as left operand of assignment
    7 |     if(N%2=0){
      |           ^
Language: C

#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int m;
m=n\2;
if(n%2==0)
printf("%d",m*2);
else
printf("%d",n*2);



return 0;  
}

Compiler output:
main.c: In function 'main':
main.c:6:4: error: stray '\' in program
    6 | m=n\2;
      |    ^
main.c:6:4: error: expected ';' before numeric constant
    6 | m=n\2;
      |    ^~
      |    ;
Language: C

#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int m=0;
m=n\2;
if(n%2==0)
printf("%d",m*2);
else
printf("%d",n*2);



return 0;  
}

Compiler output:
main.c: In function 'main':
main.c:6:4: error: stray '\' in program
    6 | m=n\2;
      |    ^
main.c:6:4: error: expected ';' before numeric constant
    6 | m=n\2;
      |    ^~
      |    ;
Language: C++

#include<bits/stdc++.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   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:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(n % 2 == 1) 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:6:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(n % 2 == 1) cout << n*2 << 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:7:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   else 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:7:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   else cout << n << 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<bits/stdc++.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   int n; 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:5:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   if(n % 2 == 1) 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:5:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |   if(n % 2 == 1) cout << n*2 << 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:6:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   else 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:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   else cout << n << 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<bits/stdc++.h>
#include<algorithm>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   int n; 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:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(n % 2 == 1) 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:6:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(n % 2 == 1) cout << n*2 << 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:7:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   else 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:7:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   else cout << n << endl;
      |                     ^~~~
      |                     std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~