criyle/codenet-compile-errors huggingface dataset:
Language: Java

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

	}

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

#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
     cin>>s;


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

#include <iostream>
#include <string>
using namespace std;
int main(){
	string str;
	cin>>str;
	if (str.suze()==3) cout<<str[2]<<str[1]<<str[0]<<endl;
	else cout<<str<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'suze'; did you mean 'size'?
    7 |         if (str.suze()==3) cout<<str[2]<<str[1]<<str[0]<<endl;
      |                 ^~~~
      |                 size
Language: Java

import java.util.*;
public class Temp{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.nextLine();
		String answer;
		switch(S.length()){
			case 2:
			answer = S;
			break;
			case 3:
			StringBuffer sb = new StringBuffer(S);
			answer = sb.reverse().toString();
			break;
			default:
			answer = "";
		}
		System.out.println(answer);
		System.out.flush();
		return;
	}
}


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

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char const *argv[])
{
	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(int, const char**)':
a.cc:12:17: error: 'reverse' was not declared in this scope
   12 |                 reverse(s.begin(), s.end());
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
 
using namespace std;
 
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   // freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
	string a;
	cin>>a;
	if(a.length()==2)
		cout<<a;
	else
		cout<<a.reverse();
	return 0 ;
}

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

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: expected primary-expression before '<' token
   38 | cout<<t<<<a;
      |          ^
Language: C++

#include <bits/stdc++.h>
int main()
{
string s;
int n=s.length();
cin>>s;
if(n==2)
{
cout<<s<<endl;
}
else
{
for(int i=n-1;i>=0;i++)
cout<<s[i];
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
    4 | string s;
      | ^~~~~~
a.cc:4:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:7: error: 's' was not declared in this scope
    5 | int n=s.length();
      |       ^
a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin>>s;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 | cout<<s<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:10: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 | cout<<s<<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:14:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | cout<<s[i];
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
int main()
{
string s;
cin>>s;
if(s.length()==2)
{
cout<<s<<endl;
}
else
{
for(int i=2;i>=0;i++)
cout<<s[i];
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
    4 | string s;
      | ^~~~~~
a.cc:4:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>s;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:6: error: 's' was not declared in this scope
    5 | cin>>s;
      |      ^
a.cc:8:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 | cout<<s<<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:10: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 | cout<<s<<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:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 | cout<<s[i];
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

#include<stdio.h>
int main(){
int A,B,K,d,n,j,xx=0;

scanf("%d %d %d",&a,&b,&k);

if(k%2==1){
n=(k-1)/2;
d++;
}else{
n=k/2;
}


for(j=0;j<=n;j++){

if(a%2==1){
xx=(a-1)/2;
a=a-1-xx;
b=b+xx;
}else{
xx=a/2;
a=a-xx;
b=b+xx;
}

if(b%2==1){
xx=(b-1)/2;
b=b-1-xx;
a=a+xx;
}else{
xx=a/2;
b=b-xx;
a=a+xx;
}

}

if(d==1){
if(a%2==1){
xx=(a-1)/2;
a=a-1-xx;
b=b+xx;
}else{
xx=a/2;
a=a-xx;
b=b+xx;
}}
printf("%d %d",&a,&b);
return 0;
}





Compiler output:
main.c: In function 'main':
main.c:5:19: error: 'a' undeclared (first use in this function)
    5 | scanf("%d %d %d",&a,&b,&k);
      |                   ^
main.c:5:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:22: error: 'b' undeclared (first use in this function)
    5 | scanf("%d %d %d",&a,&b,&k);
      |                      ^
main.c:5:25: error: 'k' undeclared (first use in this function)
    5 | scanf("%d %d %d",&a,&b,&k);
      |                         ^
Language: C

#include<stdio.h>
int main(){
int A,B,K,d,n,xx=0;

scanf("%d %d %d",&a,&b,&k);

if(k%2==1){
n=(k-1)/2;
d++;
}else{
n=k/2;
}


for(j=0;j<=n;j++){

if(a%2==1){
xx=(a-1)/2;
a=a-1-xx;
b=b+xx;
}else{
xx=a/2;
a=a-xx;
b=b+xx;
}

if(b%2==1){
xx=(b-1)/2;
b=b-1-xx;
a=a+xx;
}else{
xx=a/2;
b=b-xx;
a=a+xx;
}

}

if(d==1){
if(a%2==1){
xx=(a-1)/2;
a=a-1-xx;
b=b+xx;
}else{
xx=a/2;
a=a-xx;
b=b+xx;
}}
printf("%d %d",&a,&b);
return 0;
}




Compiler output:
main.c: In function 'main':
main.c:5:19: error: 'a' undeclared (first use in this function)
    5 | scanf("%d %d %d",&a,&b,&k);
      |                   ^
main.c:5:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:22: error: 'b' undeclared (first use in this function)
    5 | scanf("%d %d %d",&a,&b,&k);
      |                      ^
main.c:5:25: error: 'k' undeclared (first use in this function)
    5 | scanf("%d %d %d",&a,&b,&k);
      |                         ^
main.c:15:5: error: 'j' undeclared (first use in this function)
   15 | for(j=0;j<=n;j++){
      |     ^
Language: C++

#include<stdio.h>
#include<string.h>

int main(void)
{
     char str2[4];
     char str[4];
     int i=0;

	scanf("%s", str);

     i = strlen(str);

	if(i==2){
     printf("%s",str);
	}else{
     str2[2]=str[0];
     str2[1]=str[1];
     str2[0]=str[2];
     printf("%s"str2);
	}
     return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: unable to find string literal operator 'operator""str2' with 'const char [3]', 'long unsigned int' arguments
   20 |      printf("%s"str2);
      |             ^~~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>

int main(void)
{
     char str2[4]
     char str[4];
     int i=0;

	scanf("%s", str);

     i = strlen(str);

	if(i==2){
     printf("%s",str);
	}else{
     str2[2]=str[0];
     str2[1]=str[1];
     str2[0]=str[2];
     printf("%s"str2);
	}
     return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected initializer before 'char'
    7 |      char str[4];
      |      ^~~~
a.cc:10:21: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |         scanf("%s", str);
      |                     ^~~
      |                     std
a.cc:17:6: error: 'str2' was not declared in this scope
   17 |      str2[2]=str[0];
      |      ^~~~
a.cc:20:13: error: unable to find string literal operator 'operator""str2' with 'const char [3]', 'long unsigned int' arguments
   20 |      printf("%s"str2);
      |             ^~~~~~~~
Language: C++

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

int main() {
	string S;
	cin >> S;
	if (S.size == 2) {
		cout << S << endl;
	}
	else {
		vector<int> vec(S.size);
		for (int i = 0; i < S.size; i++) {
			vec.push_back(S.at(i));
			cout << reserve(vec.begin(), vec.end()) << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7: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 '()' ?)
    7 |         if (S.size == 2) {
      |             ~~^~~~
      |                   ()
a.cc:11:35: error: invalid use of non-static 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]'
   11 |                 vector<int> vec(S.size);
      |                                 ~~^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:12:39: 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 '()' ?)
   12 |                 for (int i = 0; i < S.size; i++) {
      |                                     ~~^~~~
      |                                           ()
a.cc:14:33: error: 'reserve' was not declared in this scope
   14 |                         cout << reserve(vec.begin(), vec.end()) << endl;
      |                                 ^~~~~~~
Language: C

//header
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<stdlib.h>
#include<time.h>

//main
int main(void)
{
	char s[4];

	gets_s(s);

	if (strlen(s) == 2) {
		printf("%s\n", s);
	}
	if (strlen(s) == 3) {
		for (int i = 0; i<3; i++) {
			printf("%c", s[2 - i]);
		}
		printf("\n");
	}

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:9: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
   15 |         gets_s(s);
      |         ^~~~~~
Language: C++

//header
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<stdlib.h>
#include<time.h>

//main
int main(void)
{
	char s[4];

	gets_s(s);

	if (strlen(s) == 2) {
		printf("%s\n", s);
	}
	if (strlen(s) == 3) {
		for (int i = 0; i<3; i++) {
			printf("%c", s[2 - i]);
		}
		printf("\n");
	}

	return 0;
}


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

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

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

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

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

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

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

 #include<bits/stdc++.h >
 using namespace std;
 int main(){
 	string s;
 	cin>>s;
 	int n=s.length();
 	
 	if(n%2==0)
 	{
 		cout<<s;
	 }
	 else
	 {
	 	for(int i=n-1;i>=0;i--)
		 {
		 	cout<<s[i];
		 }
	 }
	 return 0;
 }

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"stdafx.h"
#include<iostream>

using namespace std;
int main() {
	char s[2];
	cin >> s;
	int count = 0;
	for (int i = 0; i < 3; i++) {
		if (s[i] != '\n') {
			count++;
		}
	}
	if (count == 2) {
		cout << s << endl;
	}
	else {
		cout << s[2] << s[1] << s[0] << endl;
	}
	return 0;
}

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


#include <stdio.h>
#include<string.h>

int main() {
  string s;
	int i;
　　
	for (i = 0; s[i] != '\0'; ++i);

	if (i == 2) {
		printf("%s", s);
	}
	else if (i >= 3) {
		for (i; i >= 0; --i) {
			printf("%c", s[i]);
		}

	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: unknown type name 'string'; did you mean 'stdin'?
    6 |   string s;
      |   ^~~~~~
      |   stdin
main.c:8:1: error: stray '\343' in program
    8 | <U+3000><U+3000>
      | ^~~~~~~~
main.c:8:3: error: stray '\343' in program
    8 | <U+3000><U+3000>
      |         ^~~~~~~~
main.c:9:22: error: subscripted value is neither array nor pointer nor vector
    9 |         for (i = 0; s[i] != '\0'; ++i);
      |                      ^
main.c:16:39: error: subscripted value is neither array nor pointer nor vector
   16 |                         printf("%c", s[i]);
      |                                       ^
Language: C

#include <stdio.h>
#include<string.h>

using namespace std;
int main() {
	char S[100];
	int i;
　　
	for (i = 0; S[i] != '\0'; ++i);

	if (i == 2) {
		printf("%s", S);
	}
	else if (i >= 3) {
		for (i; i >= 0; --i) {
			printf("%c", S[i]);
		}

	}

	return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'using'
    4 | using namespace std;
      | ^~~~~
main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    4 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:8:1: error: stray '\343' in program
    8 | <U+3000><U+3000>
      | ^~~~~~~~
main.c:8:3: error: stray '\343' in program
    8 | <U+3000><U+3000>
      |         ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  string S;
  cin >>> S;
  if(S.size() == 2){
    cout << S << endl;
  }else{
    for(int i = 2; i >= 0; i--){
      cout << S[i] << endl;
    }
    cout << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected primary-expression before '>' token
    6 |   cin >>> S;
      |         ^
Language: C

#include<stdio.h>
#define MAX_LIMIT 20
#include<string.h>
int main()
{
  char str[10];
   gets(str);
    int length;
    length=strlen(char *str);
    if(length<3){
      printf("%s",str);
      }
      if(length>=3){
      printf("%s",strev(str));
     }
return 0;
}
   
  

Compiler output:
main.c: In function 'main':
main.c:7:4: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |    gets(str);
      |    ^~~~
      |    fgets
main.c:9:19: error: expected expression before 'char'
    9 |     length=strlen(char *str);
      |                   ^~~~
main.c:14:19: error: implicit declaration of function 'strev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   14 |       printf("%s",strev(str));
      |                   ^~~~~
      |                   strsep
Language: C++

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

int main(){
  string s,t;
  cin >> s;
  if ( s.length == 2 ) {
    cout << s << endl;
  }
  else{
    for( int i = 0; i<3; i++){
      t += s.substr(2-i, 1);
    }
    cout << t << endl;
  }
  return 0;
}

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

#include <iostream>

using namespace std;

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

    if (S.size() == 2){
        cout << S << endl;
    }else{
        sort(S.begin(), S.end());
        cout << S << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |         sort(S.begin(), S.end());
      |         ^~~~
      |         short
Language: Java

import java.util.*;

public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S=sc.next();
        if(S.length()==2){
        System.out.println(S);
        return;
        }else{
        char[] s =S.toCharArray();
        }
       for(int i=2;i=>0;i--){
       System.out.print(s[i]);
       }
System.out.println();
    }
}


Compiler output:
Main.java:20: error: illegal start of expression
       for(int i=2;i=>0;i--){
                     ^
1 error
Language: Java

import java.util.*;

public class Main {

    long INF = Long.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        String S=sc.next();
        if(S.length()==2){
        System.out.print(S);
        }else{
        char[] s =S.toCharArray();
        }
       for(int i=2;i=>0;i--){
       System.out.print(s[i]);
       }
System.out.println();
    }
}


Compiler output:
Main.java:19: error: illegal start of expression
       for(int i=2;i=>0;i--){
                     ^
1 error
Language: C++

# include<iostream>
# include<string.h>
 string s;
using namespace std;
int main(){
  	if (s.size()==2){
      cout<<s;
    }
  else cout<<s[2]<<s[1]<<s[0];
  return 0;
}

Compiler output:
a.cc:3:2: error: 'string' does not name a type; did you mean 'stdin'?
    3 |  string s;
      |  ^~~~~~
      |  stdin
a.cc: In function 'int main()':
a.cc:6:13: error: 's' was not declared in this scope
    6 |         if (s.size()==2){
      |             ^
Language: C++

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclide; did you mean #include?
    1 | #inclide<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #inclide<bits/stdc++.h>
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclide<bits/stdc++.h>
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
a.cc:6:18: error: 'cout' was not declared in this scope
    6 |   if(s.size()==2)cout<<s<<endl;
      |                  ^~~~
a.cc:6:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:27: error: 'endl' was not declared in this scope
    6 |   if(s.size()==2)cout<<s<<endl;
      |                           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclide<bits/stdc++.h>
a.cc:7:8: error: 'cout' was not declared in this scope
    7 |   else cout<<s[2]<<s[1]<<s[0]<<endl;
      |        ^~~~
a.cc:7:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:32: error: 'endl' was not declared in this scope
    7 |   else cout<<s[2]<<s[1]<<s[0]<<endl;
      |                                ^~~~
a.cc:7:32: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <algorithm>
#include <iostream>
#include <cstdio>

using namespace std ;

int n ;

int main ()
{
	scanf("%d",&n);
	int d=sqrt(2.0*n);
	if ( d*(d-1)/2!=n && (d-1)*(d-2)/2!=n && d*(d+1)/2!=n ) 
	{
		puts("No");
		return 0 ;
	}
	puts("Yes");
	printf("%d\n",n);
	for ( int i=1 ; i<=n ; i++ ) 
	{
		printf("%d ",n-1);
		for ( int j=1 ; j<=n ; j++ ) 
			if ( i^j ) printf("%d ",j);
		puts("");
	}
	return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'sqrt' was not declared in this scope
   12 |         int d=sqrt(2.0*n);
      |               ^~~~
Language: C

#include<stdio.h>
int main(){
int a,b,k,n,d,xx=0;

scanf("%d %d %d",&a,&b,&k);

if(k%2==1){
n=(k-1)/2;
d=1;
}else{
n=k/2;
}


for(j=0;j<=n;j++){

if(a%2==1){
xx=(a-1)/2;
a=a-xx;
b=b+xx;
}else{
xx=a/2;
a=a-xx;
b=b+xx;
}

if(b%2==1){
xx=(b-1)/2;
b=b-xx;
a=a+xx;
}else{
xx=a/2;
b=b-xx;
a=a+xx;
}

}

if(d==1){
if(a%2==1){
xx=(a-1)/2;
a=a-xx;
b=b+xx;
}else{
xx=a/2;
a=a-xx;
b=b+xx;
}}
printf("%d %d",&a,b);
return 0;
}



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

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

int main(){
  string s;
  cin >> s;
  if (s.size() == 2) puts(s);
  else {
    reverse(s.begin(),s.end());
    puts(s);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    7 |   if (s.size() == 2) puts(s);
      |                           ^
      |                           |
      |                           std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
a.cc:10:10: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |     puts(s);
      |          ^
      |          |
      |          std::string {aka std::__cxx11::basic_string<char>}
/usr/include/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: 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 '()' ?)
    7 |         if(s.size == 2) cout << s;
      |            ~~^~~~
      |                  ()
Language: Java

import java.util.Scanner;

public class MainABC {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while(in.hasNext()){
            String s = in.nextLine();
            if(s.length() == 2){
                System.out.println(s);
            }else{
                for (int i = s.length() - 1; i >= 0; i--) {
                    System.out.print(s.charAt(i));
                }
                System.out.println();
            }
        }
    }
}


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

#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807

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

Compiler output:
a.cc: In function 'int main()':
a.cc:33:33: error: expected ';' before 'endl'
   33 |     cout << S[2] << S[1] << S[0] endl;
      |                                 ^~~~~
      |                                 ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: 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 '()' ?)
    7 |         if(s.size == 2) cout << s;
      |            ~~^~~~
      |                  ()
a.cc:8:43: error: expected primary-expression before ']' token
    8 |         else cout << s[2] << s[1] << s[0];]
      |                                           ^
Language: C++

#include<bits/stdc++.h>
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;
}


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

#include<iostream>
#include<string>
using namespace std;
string str;
int main[]
{cin>>str;
if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
cout<<str[i]

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main[]
      |     ^~~~
a.cc:6:10: error: expected '}' before ';' token
    6 | {cin>>str;
      | ~        ^
a.cc:6:5: error: cannot convert 'std::basic_istream<char>' to 'int' in initialization
    6 | {cin>>str;
      |  ~~~^~~~~
      |     |
      |     std::basic_istream<char>
a.cc:7:1: error: expected unqualified-id before 'if'
    7 | if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
      | ^~
a.cc:7:38: error: expected unqualified-id before 'else'
    7 | if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
      |                                      ^~~~
a.cc:8:1: error: 'cout' does not name a type
    8 | cout<<str[i]
      | ^~~~
Language: C

n
n = gets.chomp.to_i
array=Array.new
for i in 0..n-1 do
	array[i]=gets.chomp.to_i
end


array=array.sort
reverse=array.reverse
minarray=Array.new
maxarray=Array.new



for i in 0..n-1 do

	if(i==0)
		minarray[0]=array[0]
		array.shift()
	elsif(i%4==1)
		minarray.insert(0,array.pop)

	elsif(i%4==2)
		minarray.push(array.pop)

	elsif(i%4==3)
		minarray.insert(0,array.first)
		array.shift()

	else
		minarray.push(array.first)
		array.shift()

	end
end


for i in 0..n-1 do

	if(i==0)
		maxarray[0]=reverse[0]
		reverse.shift()
	elsif(i%4==1)
		maxarray.insert(0,reverse.pop)
	elsif(i%4==2)
		maxarray.push(reverse.pop)
	elsif(i%4==3)
		maxarray.insert(0,reverse.first)
		reverse.shift()
	else
		maxarray.push(reverse.first)
		reverse.shift()
	end
end


sum1=0
sum2=0

for i in 0..n-2 do
		sum1 += (minarray[i]-minarray[i+1]).abs
end

for i in 0..n-2 do
		sum2 += (maxarray[i]-maxarray[i+1]).abs
end

puts [sum1,sum2].max

Compiler output:
main.c:1:1: error: unknown type name 'n'
    1 | n
      | ^
main.c:2:5: error: 'gets' undeclared here (not in a function)
    2 | n = gets.chomp.to_i
      |     ^~~~
main.c:3:1: error: expected ',' or ';' before 'array'
    3 | array=Array.new
      | ^~~~~
main.c:4:10: error: too many decimal points in number
    4 | for i in 0..n-1 do
      |          ^~~~
main.c:16:10: error: too many decimal points in number
   16 | for i in 0..n-1 do
      |          ^~~~
main.c:39:10: error: too many decimal points in number
   39 | for i in 0..n-1 do
      |          ^~~~
main.c:61:10: error: too many decimal points in number
   61 | for i in 0..n-2 do
      |          ^~~~
main.c:65:10: error: too many decimal points in number
   65 | for i in 0..n-2 do
      |          ^~~~
Language: C

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


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

#include <iostream>
#include <string.h>
#include <cmath>

void bubbleSort(int numbers[], int array_size)
{
  int i, j, temp, begin, end;

  for (i = 0; i < (array_size - 1); i++) {
    for (j = (array_size - 1); j > i; j--) {
      if (numbers[j-1] > numbers[j]) {
        temp = numbers[j-1];
        numbers[j-1] = numbers[j];
        numbers[j] = temp;
      }
    }
  }
}

using namespace std;
int main(void){

  int n, diff, diff_all = 0, begin, end;
  bool flag = true

  scanf("%d", &n);

  int a[100000];

  for(int i = 0; i < n; i++){
    scanf("%d", &a[i]);
  }

  bubbleSort(a,n);

  begin = 0;

  for(int i = 0; i < ceil(n/2.0); i++){
    if(flag){
      end = n - 1 - i;
      flag = false;
    }else{
      end = i;
      flag = false;
    }
    diff =  std::abs(a[end] - a[begin]);
    printf("%d\n", diff);
    diff_all += diff;
    begin = end;

  }

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:3: error: expected ',' or ';' before 'scanf'
   26 |   scanf("%d", &n);
      |   ^~~~~
Language: C

#include<stdio.h>
#include<string.h>
void main()
{

char a[100];
int i=0;
gets(a);
while(a[i]!='\0')
i++;
if(i==2)
{
	printf("%s",a);
}
else if(i==3)
{
	strrev(a);
    printf("%s", a);
}
}

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 | gets(a);
      | ^~~~
      | fgets
main.c:17:9: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   17 |         strrev(a);
      |         ^~~~~~
      |         strsep
Language: C++

#include<iostream>
#include<cstdio>
#include<iostream>
##include<cmath>
#include<string>
using namespace std;
string str;
int main[]
{cin>>str;
if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
cout<<str[i]

Compiler output:
a.cc:4:1: error: stray '##' in program
    4 | ##include<cmath>
      | ^~
a.cc:4:3: error: 'include' does not name a type
    4 | ##include<cmath>
      |   ^~~~~~~
a.cc:7:1: error: 'string' does not name a type; did you mean 'stdin'?
    7 | string str;
      | ^~~~~~
      | stdin
a.cc:8:5: error: cannot declare '::main' to be a global variable
    8 | int main[]
      |     ^~~~
a.cc:9:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | {cin>>str;
      |  ^~~
      |  std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:7: error: 'str' was not declared in this scope; did you mean 'std'?
    9 | {cin>>str;
      |       ^~~
      |       std
a.cc:9:10: error: expected '}' before ';' token
    9 | {cin>>str;
      | ~        ^
a.cc:10:1: error: expected unqualified-id before 'if'
   10 | if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
      | ^~
a.cc:10:38: error: expected unqualified-id before 'else'
   10 | if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
      |                                      ^~~~
a.cc:11:1: error: 'cout' does not name a type
   11 | cout<<str[i]
      | ^~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
string str;
int main[]
{cin>>str;
if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
cout<<str[i]

Compiler output:
a.cc:6:5: error: cannot declare '::main' to be a global variable
    6 | int main[]
      |     ^~~~
a.cc:7:10: error: expected '}' before ';' token
    7 | {cin>>str;
      | ~        ^
a.cc:7:5: error: cannot convert 'std::basic_istream<char>' to 'int' in initialization
    7 | {cin>>str;
      |  ~~~^~~~~
      |     |
      |     std::basic_istream<char>
a.cc:8:1: error: expected unqualified-id before 'if'
    8 | if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
      | ^~
a.cc:8:38: error: expected unqualified-id before 'else'
    8 | if[str.length[]<=2]{cout<<str<<endi;}else{for[int i=2;i>=0;i--]}
      |                                      ^~~~
a.cc:9:1: error: 'cout' does not name a type
    9 | cout<<str[i]
      | ^~~~
Language: C++

#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
  
int main(){
    int A,B,K,a,b;
    a=0;
    b=0;
    cin>>A>>B>>K;
    for(int i=0;i<K/2;i++){
    if(A%2==1){
        a=(A-1)/2;
        A=A-a;
        B=B+a;
    }
    if else(A%2==0){
        A=A-A/2;
        B=B+A/2;
    }
    if(B%2==0){
        b=(B-1)/2;
        B=B-b;
        A=A+b;
    }
    else if(B%2==1){
        B=B-B/2;
        A=A+B/2;
    }
    }
    if(K%2=1){
         if(A%2==1){
        a=(A-1)/2;
        A=A-a;
        B=B+a;
    }
    if else(A%2==0){
        A=A-A/2;
        B=B+A/2;
    }
    }
    cout<<A<<" "<<B<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: expected '(' before 'else'
   18 |     if else(A%2==0){
      |        ^~~~
      |        (
a.cc:32:9: error: lvalue required as left operand of assignment
   32 |     if(K%2=1){
      |        ~^~
a.cc:38:8: error: expected '(' before 'else'
   38 |     if else(A%2==0){
      |        ^~~~
      |        (
Language: C

#include<stdio.h>
#include<string.h>
void main()
{

char a[100];
int i=0;
gets(a);
while(a[i]!='\0')
i++;
if(i==2)
{
	printf("%s",a);
}
else
{
	strrev(a);
    printf("%s\n", a);
}
}

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 | gets(a);
      | ^~~~
      | fgets
main.c:17:9: error: implicit declaration of function 'strrev'; did you mean 'strsep'? [-Wimplicit-function-declaration]
   17 |         strrev(a);
      |         ^~~~~~
      |         strsep
Language: C++

#include<stdio.h>
#include<string.h>
void main()
{

char a[100];
int i=0;
gets(a);
while(a[i]!='\0')
i++;
if(i==2)
{
	printf("%s",a);
}
else
{
	strrev(a);
    printf("%s\n", a);
}
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 | gets(a);
      | ^~~~
      | getw
a.cc:17:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   17 |         strrev(a);
      |         ^~~~~~
      |         strsep
Language: C++

#include<cstdio>
int main(){
 int a,i;
 char s[10];
 gets (s);
 a=strlen(s);
 if(a=2){
 	 printf("%s",s);
 }
 else{
 	 for(i=a-1;i>=0:i--){
 	 	 printf("%c，s[i]);
	 }}
	 return 0;
}

Compiler output:
a.cc:12:25: warning: missing terminating " character
   12 |                  printf("%c，s[i]);
      |                         ^
a.cc:12:25: error: missing terminating " character
   12 |                  printf("%c，s[i]);
      |                         ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |  gets (s);
      |  ^~~~
      |  getw
a.cc:6:4: error: 'strlen' was not declared in this scope
    6 |  a=strlen(s);
      |    ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<cstdio>
  +++ |+#include <cstring>
    2 | int main(){
a.cc:11:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   11 |          for(i=a-1;i>=0:i--){
      |                    ^
a.cc:11:24: error: expected ';' before ':' token
   11 |          for(i=a-1;i>=0:i--){
      |                        ^
      |                        ;
a.cc:13:11: error: expected primary-expression before '}' token
   13 |          }}
      |           ^
a.cc:13:11: error: expected ';' before '}' token
   13 |          }}
      |           ^
      |           ;
a.cc:13:11: error: expected primary-expression before '}' token
a.cc:13:11: error: expected ')' before '}' token
   13 |          }}
      |           ^
      |           )
a.cc:11:13: note: to match this '('
   11 |          for(i=a-1;i>=0:i--){
      |             ^
a.cc:13:11: error: expected primary-expression before '}' token
   13 |          }}
      |           ^
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
char s[1005];
int main ()
{
	int a = 0;
	scanf("%s",&s);
	a = strlen(s);
	if (a == 2) printf("%s\n",s);
	else printf ("%s\n",strrev(s));
	return 0;
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   14 |         else printf ("%s\n",strrev(s));
      |                             ^~~~~~
      |                             strsep
Language: C++

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

char *strReverse(char *str){
	if (str == NULL || str == '\0') {
		return str;
	}
	char *start = str;
	char *end = str;
	while (*end != '\0'){ 
		end++;
	}
	char temp;
	--end;
	while (start < end){
		temp = *start;
		*start = *end;
		*end = temp;
		start++;
		end--;
	}
	return str;

 
int main(void){
	char str[1];
	scanf("%c",&str)
	if(('a'+'a')<=str[1]&&str[1]<=('z'+'z'))
	{	printf("%c",str);
		}
	else{
	cout << strReverse(str) << endl;}
	return 0;}
 


Compiler output:
a.cc: In function 'char* strReverse(char*)':
a.cc:9:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if (str == NULL || str == '\0') {
      |                            ~~~~^~~~~~~
a.cc:29:15: error: a function-definition is not allowed here before '{' token
   29 | int main(void){
      |               ^
a.cc:37:19: error: expected '}' at end of input
   37 |         return 0;}
      |                   ^
a.cc:8:28: note: to match this '{'
    8 | char *strReverse(char *str){
      |                            ^
Language: C

#include <stdio.h>
int main(){
  
    int A,B,K,i,a,b;
  
    scanf("%d", &A);
    scanf("%d", &B);
    scanf("%d", &K);
  
    i = 0;
    if(i < K){
      if(A % 2 == 0 && B % 2 == 1){
        B -= 1;
      }
      else if(A % 2 == 1 && B % 2 == 0){
        A -= 1;
      }
      else if(A % 2 == 1 && B % 2 == 1){
        A -= 1;
        B -= 1;
      }
      a = A / 2;
      A = a;
      ++i;
      if(i < K){
        break;
      }
      else {
        B = B + a;
        b = B / 2;
        A = A + b;
        B = b;
      }
      ++i;
    }
  
    printf("%d %d \n", A, B);
  
    return 0;
}
        


Compiler output:
main.c: In function 'main':
main.c:26:9: error: break statement not within loop or switch
   26 |         break;
      |         ^~~~~
Language: C

#include<stdio.h>
void main()
{
	char S;
	int i = 1, count = 0;
	while( i==1){
		S = getchar();
		if( S=='\n' ){
			i--;
			if( count==2){
				goto end;
			}
		}else {
			count++;
		}
	}
	end printf("%c", S);
	
}

Compiler output:
main.c: In function 'main':
main.c:17:9: error: unknown type name 'end'
   17 |         end printf("%c", S);
      |         ^~~
main.c:17:20: error: expected declaration specifiers or '...' before string constant
   17 |         end printf("%c", S);
      |                    ^~~~
main.c:17:26: error: expected declaration specifiers or '...' before 'S'
   17 |         end printf("%c", S);
      |                          ^
main.c:11:33: error: label 'end' used but not defined
   11 |                                 goto end;
      |                                 ^~~~
Language: C++

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

string s;
int main()
{
	int a = 0, b = 0, i = 0, j = 0;
	scanf ("%s",s);
    a = strlen(s);
    if (a == 2) printf ("%s",s);
	
    else printf ("%s",strrev(s));
	
    return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   15 |     a = strlen(s);
      |                ^
      |                |
      |                std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:18:23: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   18 |     else printf ("%s",strrev(s));
      |                       ^~~~~~
      |                       strsep
Language: C++

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

int main()
{
	char num[20];
	int i;
	scanf("%s",num);
	i=strlen(num);
	if(i==2){
		printf("%s",num);
		}
	else{
	for(i=strlen(num)-1;i>=0;i--)
	printf("%c",num[i]);
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected '}' at end of input
   19 |         }
      |          ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^