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

#include "bits:stdc++.h"
using namespace std;
int main()
{
string s;
cin >> s;
if(s.length() == 2)cout << s;
else {
reverse(s.begin(), s.end())
cout << s;
}
}

Compiler output:
a.cc:1:10: fatal error: bits:stdc++.h: No such file or directory
    1 | #include "bits:stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

int main() {
  std::string str;
  std::cin >> str;
  if (str.length() == 3) {
    std::reverse(str.begin(), str.end());
  }
  std::cout << str << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'reverse' is not a member of 'std'
    7 |     std::reverse(str.begin(), str.end());
      |          ^~~~~~~
Language: C++

////#include <iostream>
////#include <stdio.h>
////#include <sstream>
////#include <vector>
////using namespace std;
////
////#define ll long long
////#define fi first
////#define se second
////#define mp make_pair
////
#define abs(N) (((N)>0)?(N):-1*(N))
#define min(A,B) (((A)>(B))?(B):(A))
#define max(A,B) (((A)<(B))?(B):(A))
#define print(S) (cout << S)
#define println(S) (cout << S << endl)

#include <iostream>
#include <sstream>
#include <cstdio>
#include <vector>
#define ll long long int
using namespace std;


int main() {
	string s;
	cin >> s;
	if(s.length()==2){
		cout << s << endl;
	}else{
		cout << s[2] << s[1] << s[0] << endl;
	}
	return 0;
}


Compiler output:
/usr/include/stdlib.h:980:12: error: expected unqualified-id before 'int'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
/usr/include/stdlib.h:980:12: error: expected ')' before 'int'
a.cc:12:18: note: to match this '('
   12 | #define abs(N) (((N)>0)?(N):-1*(N))
      |                  ^
/usr/include/stdlib.h:980:12: error: expected ')' before 'int'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:12:17: note: to match this '('
   12 | #define abs(N) (((N)>0)?(N):-1*(N))
      |                 ^
/usr/include/stdlib.h:980:12: error: expected ')' before 'int'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:12:16: note: to match this '('
   12 | #define abs(N) (((N)>0)?(N):-1*(N))
      |                ^
In file included from /usr/include/c++/14/cstdlib:81,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:18:
/usr/include/c++/14/bits/std_abs.h:52:11: error: 'abs' has not been declared in '::'
   52 |   using ::abs;
      |           ^~~
Language: Java

public class atCoder {
	public static void main(String[] args) {
		if(args[0].length() == 2){
			System.out.println(args[0]);
		}else{
            System.out.print(args[0].charAt(2));
            System.out.print(args[0].charAt(1));
            System.out.println(args[0].charAt(0));
        }

	}
}

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

import java.util.*;
public class Test {
    public static void main(String[] args) {
  Scanner sc=new Scanner(System.in);
String S=sc.next();
String ans; 
if(S.length()==2){
ans=S;
}
else{
        ans=S.substring(2,3)+S.substring(1,2)+S.substring(0,1);
        }
System.out.println(ans);
    }
}

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

#include <stdio.h>
#include <stdlib.h>

int main(){
    int a,b;
    char c[100];
 scanf("%s",&c);

 if(strlen(c)>2){
     printf("%s\n",c);
     return 0;
 }
 else
         printf("%c%c\n",c[1],c[0]);
 return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'strlen' was not declared in this scope
    9 |  if(strlen(c)>2){
      |     ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <stdlib.h>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;

int main() {
  string s;
  cin >> s;
if(s.length()==2){
  cout << s << endl;
}else{
  cout << (s.reverse()) << endl;
}


}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'reverse'; did you mean 'reserve'?
   16 |   cout << (s.reverse()) << endl;
      |              ^~~~~~~
      |              reserve
Language: C++

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

typedef vector<int> veci;
typedef pair<int, int> pii;
typedef vector<pii> vecii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vecl;
typedef vector<pll> vecll;
#define EPS (1e-9)
#define MOD (1e9 + 7)
#define fi first
#define se second
#define endl '\n'

void solve() {
    sting s;
    cin >> s;

    if (s.size()==3) {
        reverse(s.begin(), s.end());
    }
    cout << s << endl;
}

int main(int argc, char* argv[]) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LOCAL_TEST
    (void)argc;
    const string strpath = string(argv[0]) + string("-test.in");
    freopen(strpath.c_str(), "r", stdin);
    int tcs;
    cin >> tcs;
    while (tcs-- > 0)
#endif
    solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:18:5: error: 'sting' was not declared in this scope
   18 |     sting s;
      |     ^~~~~
a.cc:19:12: error: 's' was not declared in this scope; did you mean 'se'?
   19 |     cin >> s;
      |            ^
      |            se
Language: C++

#include <iostream>
#include <vector>
#include <map>
using namespace std;


int main() {
    string N; cin >> N;
    if(N.size()!=2) reverse(N.begin(), N.end());
    cout << N << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'reverse' was not declared in this scope
    9 |     if(N.size()!=2) reverse(N.begin(), N.end());
      |                     ^~~~~~~
Language: C++

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


int main()
{
	string S;
	cin >> S;
	size_t size = S.length();
	switch (size)
	{
	case 2:
			cout << S << endl;
		break;
		case 3:
			reverse(S.begin(), S.end());
			cout << S << endl;
			break;

	}
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: 'reverse' was not declared in this scope
   18 |                         reverse(S.begin(), S.end());
      |                         ^~~~~~~
Language: C++

#include <string>

using namespace std;
int main (void) {
	string s;
	cin >> s;

	if (s.size() == 2) {
		cout << s << endl;
		return 0;
	}else {
		cout << s[2] << s[1] << s[0];
		return 0;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> s;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | 
a.cc:9:17: error: 'cout' was not declared in this scope
    9 |                 cout << s << endl;
      |                 ^~~~
a.cc:9:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:30: error: 'endl' was not declared in this scope
    9 |                 cout << s << endl;
      |                              ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 | 
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << s[2] << s[1] << s[0];
      |                 ^~~~
a.cc:12:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main(void){
	ios::sync_with_stdio(false);
	string s,a;
	cin >> s;
	int n=s.size();
	if (n == 3) {
		a[0] = s[2];
		s[2] = s[0];
		s[0] = a[0]:
	}

	cout << s;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ';' before ':' token
   15 |                 s[0] = a[0]:
      |                            ^
      |                            ;
Language: C++

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

int main()
{
    string S;
    cin >> S;

    if( S.length() == 3 ) reverse(S.begin(), S.end());

    cout << S << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: 'reverse' was not declared in this scope
   10 |     if( S.length() == 3 ) reverse(S.begin(), S.end());
      |                           ^~~~~~~
Language: C

#include<stdio.h>
int main(){
  char s[4];
  scanf("%s",s);
  if(s[2]=='\0') printf("%s",s);
  else 
    for(int i=2;i>=0;i--)
      printf("%c",c[i]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:19: error: 'c' undeclared (first use in this function)
    8 |       printf("%c",c[i]);
      |                   ^
main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main()
{
  string s;
  cin >> s;
  if (s.size() == 3) {
    reverse(begin(s), end(s));
  }
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'reverse' was not declared in this scope
   10 |     reverse(begin(s), end(s));
      |     ^~~~~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String [] args) {
        Scanner sc = new Scanner();
        String S = sc.next();
        sc.close();
        int length = S.length();
        if(length == 2) {
            char [] array = S.toCharArray();
            for (int i = 3; i >=0; i --) {
                 System.out.print(array[i])
            }
        } else {
                System.out.println(S);
        }
    }
}

Compiler output:
Main.java:12: error: ';' expected
                 System.out.print(array[i])
                                           ^
1 error
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main(){
	string n;
	cin>>n;
	int a=n.length();
	if(a==2)
	cout<<n<<endl;
	else if(a==3){
		for(int i=a-1;i>=0;i--){
			printf("%c",n[i]);
		}
		printf("\n");
	}
	return 0;
} 

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

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

int main(void){
	ios::sync_with_stdio(false);
	string s,a;
	cin >> s;
	int n=s.size();
	if (n == 3) {
		a = s[2];
		s[2] = s[0];
		s[0] = a:
	}

	cout << s;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   15 |                 s[0] = a:
      |                        ^
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
Language: C++

#include<iostream>
#include<string>

int main() {
	std::string str;
	std::cin >> str;

	if (str.size() == 3) {
		std::reverse(str.begin(), str.end());
	}

	std::cout << str << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'reverse' is not a member of 'std'
    9 |                 std::reverse(str.begin(), str.end());
      |                      ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <string>

using namespace std;

int main() {
	string S;
	cin >> S;

	if(S.length() == 3) {
		reverse(S.begin(), S.end());
	}
	cout << S << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'reverse' was not declared in this scope
   13 |                 reverse(S.begin(), S.end());
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char const *argv[]) {
	string str;
	std::cin >> str;
	if (str.size() == 3) {
		reverse(str.begin(), str.end());
		std::cout << str << '\n';
	}
	else {
		std::cout << str << '\n';
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:10:17: error: 'reverse' was not declared in this scope
   10 |                 reverse(str.begin(), str.end());
      |                 ^~~~~~~
Language: C++

#include<algorithm>
#include<iostream>
#include<cstring>
#include<queue>
#include<string>
using namespace std;
int main(){
	string s;
	cin>>s;
	int l=s.length();
	if(l==2){
		cout<<s;
	}
	else{
		for(int i=2;i>=;i--){
			cout<<s[i];
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: expected primary-expression before ';' token
   15 |                 for(int i=2;i>=;i--){
      |                                ^
Language: C++

function getLines(input){
	return input.split("\n").map((s)=>s.trim())
}
function parseLine(line){
	return line.split(" ").map((s)=>s.trim());
}
function parseLineToInt(line){
	return line.split(" ").map((s)=>parseInt(s.trim()));
}
// parameter "input" gets all data
function Main(input) {
	// the first line is assigned to input[0], the second line is assigned to input[1] similarly.	
	input = input.trim();
	if(input.length==2)
		console.log(input)
	else{
		var s='';
		for (var i = 0; i < input.length; i++) {
			s=s+input[input.length-1-i];
		}
		console.log(s)
	}
	
}
// Don't edit this line!
//Main(require("fs").readFileSync(__dirname+'/in.txt', "utf8"));
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Compiler output:
a.cc:17:23: error: empty character constant
   17 |                 var s='';
      |                       ^~
a.cc:27:14: warning: multi-character character constant [-Wmultichar]
   27 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |              ^~~~
a.cc:27:33: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   27 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                 ^~~~~~~~~~~~
a.cc:27:47: warning: multi-character character constant [-Wmultichar]
   27 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                               ^~~~~~
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function getLines(input){
      | ^~~~~~~~
      | union
a.cc:4:1: error: 'function' does not name a type; did you mean 'union'?
    4 | function parseLine(line){
      | ^~~~~~~~
      | union
a.cc:7:1: error: 'function' does not name a type; did you mean 'union'?
    7 | function parseLineToInt(line){
      | ^~~~~~~~
      | union
a.cc:11:1: error: 'function' does not name a type; did you mean 'union'?
   11 | function Main(input) {
      | ^~~~~~~~
      | union
a.cc:27:5: error: expected constructor, destructor, or type conversion before '(' token
   27 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |     ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <time.h>
#include <stdio.h>
#include <vector>
#define int long long
using namespace std;
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int mypow(int x, int y) {
	if (y == 0)return 1;
	if (y % 2)return mypow(x, y - 1)*x;
	else return mypow(x, y / 2)*mypow(x, y / 2);
}
int Max(int x, int y) {
	if (x > y)return x;
	else return y;
}
int Min(int x, int y) {
	if (x < y)return x;
	else return y;
}
int kai(int x) {
	int cnt=1;
	if (x == 0)return 1;
	cnt = kai(x - 1);
	return x * cnt;
}
inline void shoki()
{
	srand((unsigned int)time(NULL));
}
 
/*Library End!*/
 
signed main() {

Compiler output:
a.cc: In function 'int main()':
a.cc:46:16: error: expected '}' at end of input
   46 | signed main() {
      |               ~^
Language: Java

import java.util.Scanner;

public Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String N = in.next();
		if(N.length()==2) {
			System.out.println(N);
		}else {
			for(int i=0;i<3;i++) {
				System.out.print(N.charAt(2-i));
			}
		}

	}
}


Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Main {
       ^
Main.java:4: 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)
Main.java:16: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

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

int main(void){
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	int n=s.size();
	if (n == 3) {
		s[3] = s[1];
		s[1] = s[3]:
	}

	cout << s;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: expected ';' before ':' token
   14 |                 s[1] = s[3]:
      |                            ^
      |                            ;
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
int main(){
	string a;
	cin>>a;
	if(a.length()==2){
		cout<<a<<endl;
	}else{
		a.reserve();
		cout<<a<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string a;
      |         ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>a;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:14: error: 'a' was not declared in this scope
    6 |         cin>>a;
      |              ^
a.cc:8:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |                 cout<<a<<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:8:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |                 cout<<a<<endl;
      |                          ^~~~
      |                          std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:11:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |                 cout<<a<<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:11:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |                 cout<<a<<endl;
      |                          ^~~~
      |                          std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

/* Author rumoisen */
/* created 2018/10/24 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cmath>
 
using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}
void No(){cout<<"NO"<<endl;exit(0);}
void Yes(){cout<<"YES"<<endl;exit(0);}

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

using namespace std;

int ketasu(long long int n)
{
    int a=0;
    while(n>0){
        a++;
        n/=10;
    }
    return a;
}
int main()
{
    string s;
    cin>>s;
    if(s.size()==2) cout<<s<,endl;
    else{
        reverse(s.begin(),s.end());
        cout<<s<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:29: error: expected primary-expression before ',' token
   49 |     if(s.size()==2) cout<<s<,endl;
      |                             ^
Language: C++

#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
int main(){
  string s;
  cin >> s;
  if(s.size() == 3) {
    string t = s[0];
    string u = s[2];
    cout << u + s[1] + t << endl;
  }
  else cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |     string t = s[0];
      |                   ^
a.cc:10:19: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |     string u = s[2];
      |                   ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#define sn(n) scanf("%d",&n)
#define pr(n) printf("%d",n)
#define pn printf("\n")
#define ll long long
#define p 1000000005
int n,m;
int main()
{
    char s[10];
    scanf("%s",s);
    if(strlen(s)==2)
        printf("%s\n",s);
    else
    {
        for(int i=2;i>=0;i--)
            printf("%c",s[i]);
        pn;
    }
    return 0;
}


/*

Lucas(卢卡斯)定理

ll pow_quick(ll a, ll b)

{

    ll  ans =1;

    while(b)

    {

        if(b &1)  ans = ans * a % p;

        b>>=1;

        a = a*a % p;

    }

    return  ans;

}

ll C(ll n, ll m)

{

    if(m > n)  return 0;

    ll ans = 1;
    for(ll i=1; i<=m; i++)
    {
        ll a = (n+i-m)%p;

        ll b = i%p;

        ans = (ans*(a*pow_quick(b,p-2)%p))%p;

    }
    return ans;
}

ll Lucas(ll n, ll m )

{

    if(m ==0)  return 1;

    else return  (C(n%p, m%p)*Lucas(n/p, m/p))%p;

}


*/


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'strlen' was not declared in this scope
   14 |     if(strlen(s)==2)
      |        ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | #define sn(n) scanf("%d",&n)
Language: C++

#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a) for(int i=0;i<a;i++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline ll kaizyo(ll);
ll gcd(ll, ll);
ll combination(ll, ll);
int main() {
	string s;
	cin >> s;
	if (s.size == 2) {
		cout << s;
	}
	else {
		cout << s[2] << s[1] << s[0];
	}
	return 0;
}


inline ll kaizyo(ll x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |         if (s.size == 2) {
      |             ~~^~~~
      |                   ()
Language: C++

#include <iostream>


using namespace std;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if (s.length()==2) cout << s << endl;
    else {
        reverse(s.begin(),s.end());
        cout << s << endl;
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'reverse' was not declared in this scope
   14 |         reverse(s.begin(),s.end());
      |         ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
string s;
int main(){
  cin >> s;
  if(s.size() == 3) {
    string t = s[0];
    string u = s[2];
    cout << u + s[1] + t << endl;
  }
  else cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |     string t = s[0];
      |                   ^
a.cc:10:19: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |     string u = s[2];
      |                   ^
Language: C++

#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a) for(int i=0;i<a;i++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline ll kaizyo(ll);
ll gcd(ll, ll);
ll combination(ll, ll);
int main() {
	string s;
	cin >> s;
	if (s.size = 2) {
		cout << s;
	}
	else {
		cout << s[2] << s[1] << s[0];
	}
	return 0;
}


inline ll kaizyo(ll x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a%b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |         if (s.size = 2) {
      |             ~~^~~~
      |                   ()
Language: C++

#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <regex>
#include <bitset>
#include <string>
#include <vector>
#include <iomanip>
#include <sstream>
#include <utility>
#include <iterator>
#include <algorithm>
#include <functional>
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define pq priority_queue<int,vector<int>,greater<int>>
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
#define INF 9999999999
#define F first
#define S second

using namespace std;

typedef pair<int, int> pi;
typedef pair<int, pi> pp;

int dx[] = { 1, -1, 0, 0 };
int dy[] = { 0, 0, 1, -1 };
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

int main() {
	string s;
	cin >> s;
	s.size() - 2 ? cout << reverse(s) << endl : cout << s << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:39: error: no matching function for call to 'reverse(std::string&)'
   40 |         s.size() - 2 ? cout << reverse(s) << endl : cout << s << endl;
      |                                ~~~~~~~^~~
In file included from /usr/include/c++/14/regex:52,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)'
 1083 |     reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
      |     ^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1083:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:16:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)'
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#a,b=map(int,input().split())
s=input()
if len(s)==2:
    print(s)
elif len(s)==3:
    for i in range(len(s)):
        print(s[len(s)-i-1],end='')
        

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #a
    1 | #a,b=map(int,input().split())
      |  ^
a.cc:7:33: error: empty character constant
    7 |         print(s[len(s)-i-1],end='')
      |                                 ^~
a.cc:2:1: error: 's' does not name a type
    2 | s=input()
      | ^
Language: Java

import java.util.*;
import java.math.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String str = sc.next();

		if(str.length()==2){

			System.out.println(str);
		}else{
			
		System.out.println(str.reverse());
		}




	}

}

Compiler output:
Main.java:15: error: cannot find symbol
		System.out.println(str.reverse());
		                      ^
  symbol:   method reverse()
  location: variable str of type String
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	if (s.lenght()%2==0)
	cout<<s;
	else
	{
		reverse(s.begin(),s.end());
	cout<<s;
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
    7 |         if (s.lenght()%2==0)
      |               ^~~~~~
      |               length
Language: C++

# cook your dish here
s=list(input())
ass = ''
if len(s) == 2:
    ass = s[0]+s[1]
else:
    ass = s[2]+s[1]+s[0]
print(ass)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #cook
    1 | # cook your dish here
      |   ^~~~
a.cc:3:7: error: empty character constant
    3 | ass = ''
      |       ^~
a.cc:2:1: error: 's' does not name a type
    2 | s=list(input())
      | ^
Language: C++

def getN():
    return int(input())


def getNM():
    return map(int, input().split())


def getList():
    return list(map(int, input().split()))

s = input()

if len(s) == 2:
    print(s)

if len(s) == 3:
    print(s[::-1])

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

#include <bits/stdc++.h>
using namespace std;
void y(){
	cout<<"yes";
}
void Y(){
	cout<<"Yes";
}
void n(){
	cout<<"no";
}
void N(){
	cout<<"No";
}
int main() {
	int a,b,c;
	int num=0,max=1000000;
	char c[3];
	cin>>c[0]>>c[1]>>c[2];
	cout<<c[2]<<c[1]<<c[0];
	
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: conflicting declaration 'char c [3]'
   18 |         char c[3];
      |              ^
a.cc:16:17: note: previous declaration as 'int c'
   16 |         int a,b,c;
      |                 ^
a.cc:19:15: error: invalid types 'int[int]' for array subscript
   19 |         cin>>c[0]>>c[1]>>c[2];
      |               ^
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |         cin>>c[0]>>c[1]>>c[2];
      |                     ^
a.cc:19:27: error: invalid types 'int[int]' for array subscript
   19 |         cin>>c[0]>>c[1]>>c[2];
      |                           ^
a.cc:20:16: error: invalid types 'int[int]' for array subscript
   20 |         cout<<c[2]<<c[1]<<c[0];
      |                ^
a.cc:20:22: error: invalid types 'int[int]' for array subscript
   20 |         cout<<c[2]<<c[1]<<c[0];
      |                      ^
a.cc:20:28: error: invalid types 'int[int]' for array subscript
   20 |         cout<<c[2]<<c[1]<<c[0];
      |                            ^
Language: C++

#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
#include<iomanip>
#include<map>
using namespace std;
int main(){
    string s;
    cin>>s;
    if(s.length()==2)cout<<s;
    else cout<<s[2]<<s[1]<<s[0];
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin>>s;
      |     ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include<map>
  +++ |+#include <iostream>
    9 | using namespace std;
a.cc:13:22: error: 'cout' was not declared in this scope
   13 |     if(s.length()==2)cout<<s;
      |                      ^~~~
a.cc:13:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:10: error: 'cout' was not declared in this scope
   14 |     else cout<<s[2]<<s[1]<<s[0];
      |          ^~~~
a.cc:14:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main() {
  int A, B, K;
  cin >> A >> B >> K;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      if (A % 2 == 1) A -= 1;
      B += A / 2;
      A /= 2;
    }
    else {
      if (B % 2 == 1) B -= 1;
      A += B / 2;
      B /= 2;
    }
  }
  cout << A << " " << B << endl;
}

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

#include <iostream>

using namespace std;

int main(){
  int a,b,k;
  cin>>a>>b>>k;
  for(int i=0;i<K;i++){
    if(i&1){
      b/=2;
      a+=b;
    }
    else{
      a/=2;
      b+=a;
    }
  }
  cout<<a<<" "<<b;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'K' was not declared in this scope
    8 |   for(int i=0;i<K;i++){
      |                 ^
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int a = scn.nextInt();
		int b = scn.nextInt();
      	int k = scn.nextInt();
      	if(k%2==1){
          for(int i=1; i<=(k-1)/2; ++i){
            if(a%2==1){
              a = a - 1;
            }
            a = a/2;
            b = b + a;
            if(b%2==1){
              b = b - 1;
            }
            b = b/2;
            a = a + b;
          }
          if(a%2==1){
              a = a - 1;
            }
            a = a/2;
            b = b + a;
        }else{
          for(int i=1; i<=k/2; ++i){
            if(a%2==1){
              a = a - 1;
            }
            a = a/2;
            b = b + a;
            if(b%2==1){
              b = b - 1;
          	}
            b = b/2;
            a = a + b;
         }
        }
      System.out.print(a b);
	}
}


Compiler output:
Main.java:41: error: ')' or ',' expected
      System.out.print(a b);
                        ^
Main.java:41: error: not a statement
      System.out.print(a b);
                         ^
Main.java:41: error: ';' expected
      System.out.print(a b);
                          ^
3 errors
Language: C++

A, B, K = map(int, input().split())

cnt = 0
for i in range(K):
    if i % 2 == 0:
        if A % 2 != 0:
            A = (A-1) // 2
        else:
            A //= 2
        B += A

    else:
        if B % 2 != 0:
            B = (B-1) // 2
        else:
            B //= 2
        A += B

    cnt += 1

print(A, B)


Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A, B, K = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    long a,b,k;
    cin>>a>>b>>k;
    for(int i=1; i<=k; ++i){
        if(i%2==1){
            a/=2;
            b+=a;
        }
        else{
            b/=2;
            a+=b;
        }
    }
    cout<<a<<" "<<b<<endl;
}#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    long a,b,k;
    cin>>a>>b>>k;
    for(int i=1; i<=k; ++i){
        if(i%2==1){
            a/=2;
            b+=a;
        }
        else{
            b/=2;
            a+=b;
        }
    }
    cout<<a<<" "<<b<<endl;
}

Compiler output:
a.cc:19:2: error: stray '#' in program
   19 | }#include <bits/stdc++.h>
      |  ^
a.cc:19:3: error: 'include' does not name a type
   19 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(){
      |     ^~~~
Language: C

#include <stdio.h
int main(){
  int taka,aoki;
  int n,i;
  
  scanf("%d %d %d",&taka,&aoki,&n);
  
  for(i=0;i<n;i++){
    if(i%2==0){
      taka/=2;
      aoki+=taka;
    } else {
      aoki/=2;
      taka+=aoki;
    }
  }
  printf("%d %d",taka,aoki);
}

Compiler output:
main.c:1:18: error: missing terminating > character
    1 | #include <stdio.h
      |                  ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    ll A, B;
    cin >> A >> B;
    REP(i, K) {
        if(i % 2 == 0) {
            if(A % 2 == 1) {
                A--;
            } else {
                B += A / 2;
                A = A / 2;
            }
        } else {
            if(B % 2 == 1) {
                B--;
            } else {
                A += B / 2;
                B = B / 2;
            }
        }
    }
    cout << A << " " << B << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:12: error: 'K' was not declared in this scope
   39 |     REP(i, K) {
      |            ^
a.cc:2:41: note: in definition of macro 'REP'
    2 | #define REP(i, n) for(ll i = 0; i < (ll)n; i++)
      |                                         ^
Language: C++

#include<bits/stdcc++.h>
using namespace std;
using ll=long long;
int main(){
  ll a,b;int k;cin>>a>>b>>k;
  for(int i=0;i<k;i++){
    if(k%2==0){a/=2;b+=a;}
    else{b/=2;a+=b;}
  }
  cout<<a<<' '<<b<<endl;
}
   
  

Compiler output:
a.cc:1:9: fatal error: bits/stdcc++.h: No such file or directory
    1 | #include<bits/stdcc++.h>
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int k = sc.nextInt();
      for(int i = 0;i < k;i+=2){
      	int b = b+a/2;
        int a = a+b/2;
      }
      if(k%2==1)b=b+a/2;
      System.out.println(a+" "+b);
    }
}

Compiler output:
Main.java:9: error: variable b is already defined in method main(String[])
      	int b = b+a/2;
      	    ^
Main.java:10: error: variable a is already defined in method main(String[])
        int a = a+b/2;
            ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long a,b,k;
  cin >> a >> b >> k;
  for(int i=1;i<=k;i++){
    if(i%2==1){
      b+=a/2;
      a/=2:
    }
    else{
      a+=b/2;
      b/=2;
    }
  }
  cout << a << " " << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before ':' token
    9 |       a/=2:
      |           ^
      |           ;
Language: C++

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

int main() {
    int a,b,k;
    cin >> a >> b >> k;
    for (int i=0;i<k;i++) {
        if (i%2==0) {
            if (a%2==1) {a--;}
            b += a/2;
            a/=2;
        }
        else {
            if (b%2==1) {b--;}
            a += b/2;
            b/=2;
        }
    }
    cout << a << " " << b << endl;
    return 0;

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = (int)1e9 + 7;
const int INF = (int)100100100;

int main() {
    //ll N; cin >> N;
    ll A,B; cin >> A >> B;
    //string S; cin >> S;
    //ll H,W; cin >> H >> W;
    int K;
    cin >> K;
    for(int i=0;i<K;i++){
        if(ia%2==0){
          A=A/2;
          B+=A;
        }
        else{
          B=B/2;
          A+=B;
        }
    }
    


    cout << A << ' ' << B << endl;
}

/*



 */



Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'ia' was not declared in this scope; did you mean 'i'?
   15 |         if(ia%2==0){
      |            ^~
      |            i
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
  int A,B,K;
  cin >> A >> B >> K;

  int turn = 0;

  for(int i=0;i<K;i++){
    if(turn == 0){
      if(A % 2 == 1)
        A--;;
      B += A / 2;
      A /= 2
      turn = 1;
    }
    else{
      if(B % 2 == 1)
        B--;
        A += B / 2;
        B /= 2;
      turn = 0;
    }
  }

  cout << A << " " << B << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected ';' before 'turn'
   15 |       A /= 2
      |             ^
      |             ;
   16 |       turn = 1;
      |       ~~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

void solve() {
  int a, b, k;
  cin >> a >> b >> k;
  for(int i = 0; i < n; i++) {
    int& from = (i%2==0 ? a : b);
    int& to = (i%2==1 ? a : b);
    if(from%2) from--;
    to += from/2;
    from /= 2;
  }
  cout << a << " " << b << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


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

#!/usr/bin/env python3

A, B, K = map(int,input().split())

for i in range(K):
    if A % 2 == 1:
        A -= 1

    B += A / 2
    A -= A / 2
    
    if B % 2 == 1:
        B -= 1
    
    A += B / 2
    B = B / 2

print(A, B)




Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python3
      |  ^
a.cc:3:1: error: 'A' does not name a type
    3 | A, B, K = map(int,input().split())
      | ^
Language: Java

public class Main {

  private class ValueManager {

    private long a;

    private long b;

    private int k;

    private long[] aSum;

    private long[] bSum;

    private int idx = 0;

    public ValueManager(long a, long b, int k) {
      super();
      this.a = a;
      this.b = b;
      this.k = k;
      this.aSum = new long[this.k];
      this.bSum = new long[this.k];
    }

    public boolean calcuNumCookies(String downTarget) {
      if ("a".equals(downTarget)) {
        this.a = (this.a % 2 != 0) ? this.a - 1 : this.a;

        final long half = this.a / 2;
        this.a -= half;
        this.b += half;

      } else if ("b".equals(downTarget)) {
        this.b = (this.b % 2 != 0) ? this.b - 1 : this.b;

        final long half = this.b / 2;
        this.b -= half;
        this.a += half;
      }

      this.aSum[idx] = a;
      this.bSum[idx] = b;

      return (this.k == ++this.idx);
    }

    public long getFinalValueA() {
      return this.aSum[aSum.length - 1];
    }

    public long getFinalValueB() {
      return this.bSum[bSum.length - 1];
    }
  }

  public static void main(String[] args) {

    Main main = new Main();
    Main.ValueManager vManager = null;
    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
      String[] tmp = br.readLine().split("\\s");
      final long a = Long.valueOf(tmp[0]);
      final long b = Long.valueOf(tmp[1]);
      final int k = Integer.parseInt(tmp[2]);
      vManager = main.new ValueManager(a, b, k);
    } catch (IOException e) {
      e.printStackTrace();
      System.exit(1);
    }

    while (true) {
      boolean bFlag = vManager.calcuNumCookies("a");
      if (bFlag) {
        break;
      }
      bFlag = vManager.calcuNumCookies("b");
      if (bFlag) {
        break;
      }
    }

    System.out.printf("%d %d", vManager.getFinalValueA(), vManager.getFinalValueB());
  }
}

Compiler output:
Main.java:61: error: cannot find symbol
    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
         ^
  symbol:   class BufferedReader
  location: class Main
Main.java:61: error: cannot find symbol
    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
                                 ^
  symbol:   class BufferedReader
  location: class Main
Main.java:61: error: cannot find symbol
    try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
                                                    ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:67: error: cannot find symbol
    } catch (IOException e) {
             ^
  symbol:   class IOException
  location: class Main
4 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  cin >> a >> b >> k;
  bool turn = true;
  for(int i = 0; i < k; ++i) {
    if(turn) {
      if(a % 2 == 1) --a;
      a /= 2;
      b += a;
    } else {
      if(b % 2 == 1) --b;
      b /= 2;
      a += b;
    }
    turn = !turn;
  }
  cout << a << " " << b << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> k;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> k;
      |               ^
a.cc:6:20: error: 'k' was not declared in this scope
    6 |   cin >> a >> b >> k;
      |                    ^