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

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

char s[10];
char t[10];
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:19:23: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   19 |     else printf ("%s",strrev(s));
      |                       ^~~~~~
      |                       strsep
Language: C++

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

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

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

char s[1000005];
char t[1000005];
int main()
{
	int a = 0, b = 0, i = 0, j = 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:19:25: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   19 |     else printf ("%s\n",strrev(s));
      |                         ^~~~~~
      |                         strsep
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'str' was not declared in this scope; did you mean 'std'?
    4 | str N;
      | ^~~
      | std
a.cc:5:8: error: 'N' was not declared in this scope
    5 | cin >> N;
      |        ^
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<3;i++){
      |     ^
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        boolean x = false;
        for(int i=1; i<n; i++){
            if(i*(i-1) == 2n){
                x = true;
            }
        }
        if(x){
            System.out.println("yes");
        }else{
            System.out.println("no");
        }
    }
}

Compiler output:
Main.java:9: error: ')' expected
            if(i*(i-1) == 2n){
                           ^
Main.java:9: error: ';' expected
            if(i*(i-1) == 2n){
                            ^
2 errors
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: 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){
      |      ~~^~~~
      |            ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(void)
{
const int x=3;
char a[x];
int n;
gets(a);
n=strlen(a);
if (n==2)

{
	
cout<<a;

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

Compiler output:
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
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
	char str[3];
	
	scanf("%s",&str);
	
	if(strlen(str)==2)
		printf("%s",str);
	else
		printf("%s",strrev(str));
}

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

#include <stdio.h>
#include <string.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
const int x=3;
char a[x];
int n;
gets(a);
n=strlen(a);
if (n==2)

{
	
cout<<a;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 | gets(a);
      | ^~~~
      | getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
const int x=3;
char a[x];
int n;
gets(a);
n=strlen(a);
if (n==2)

{
	
cout<<a;

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

Compiler output:
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
Language: C++

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

int main(){
string a;
cin >>a;
if(a.size()%2){
for(int i=0;i<a.size();i++;){

cout << a[i];
}
cout<< endl;
return 0;
}
cout <<a << endl;
return 0;
}

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

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {

            var s = Console.ReadLine();

            if (s.Length == 2)
            {
                Console.WriteLine(s);
            }
            else
            {
                Console.WriteLine(new String(s.Reverse().ToArray()));
            }
    }
}




Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:7:22: error: 'string' has not been declared
    7 |     static void Main(string[] args)
      |                      ^~~~~~
a.cc:7:31: error: expected ',' or '...' before 'args'
    7 |     static void Main(string[] args)
      |                               ^~~~
a.cc:21:2: error: expected ';' after class definition
   21 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:10:13: error: 'var' was not declared in this scope
   10 |             var s = Console.ReadLine();
      |             ^~~
a.cc:12:17: error: 's' was not declared in this scope
   12 |             if (s.Length == 2)
      |                 ^
a.cc:14:17: error: 'Console' was not declared in this scope
   14 |                 Console.WriteLine(s);
      |                 ^~~~~~~
a.cc:18:17: error: 'Console' was not declared in this scope
   18 |                 Console.WriteLine(new String(s.Reverse().ToArray()));
      |                 ^~~~~~~
a.cc:18:39: error: expected type-specifier before 'String'
   18 |                 Console.WriteLine(new String(s.Reverse().ToArray()));
      |                                       ^~~~~~
Language: C++

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

int main(){
string a;
cin >>a;
if(a.size()%2){
for(int i=0;i<a.size();i++;){

cout << a[i];
}
cout<< endl;
return 0;
}
cout <<a << endl;
return 0;
}

Compiler output:
a.cc:1:4: error: stray '#' in program
    1 | kっ#include<bits/stdc++.h>
      |    ^
a.cc:1:1: error: 'k\U00003063' does not name a type
    1 | kっ#include<bits/stdc++.h>
      | ^~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string a;
      | ^~~~~~
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin >>a;
      | ^~~
a.cc:6:7: error: 'a' was not declared in this scope
    6 | cin >>a;
      |       ^
a.cc:8:27: error: expected ')' before ';' token
    8 | for(int i=0;i<a.size();i++;){
      |    ~                      ^
      |                           )
a.cc:8:28: error: expected primary-expression before ')' token
    8 | for(int i=0;i<a.size();i++;){
      |                            ^
a.cc:12:1: error: 'cout' was not declared in this scope
   12 | cout<< endl;
      | ^~~~
a.cc:12:8: error: 'endl' was not declared in this scope
   12 | cout<< endl;
      |        ^~~~
a.cc:15:1: error: 'cout' was not declared in this scope
   15 | cout <<a << endl;
      | ^~~~
a.cc:15:13: error: 'endl' was not declared in this scope
   15 | cout <<a << endl;
      |             ^~~~
Language: C++

#include <cstdlib>
#include <iostream>
 
int
main()
{
 
char str[128]= {}; ;
std::cin >> str;

if( str[2] == "\0")
{
    std::cout << str<< std::endl;
}
else
{
    std::cout << str[2] << str<<[1] << str[0]<< std::endl;
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if( str[2] == "\0")
      |     ~~~~~~~^~~~~~~
a.cc:17:34: error: expected identifier before numeric constant
   17 |     std::cout << str[2] << str<<[1] << str[0]<< std::endl;
      |                                  ^
a.cc: In lambda function:
a.cc:17:37: error: expected '{' before '<<' token
   17 |     std::cout << str[2] << str<<[1] << str[0]<< std::endl;
      |                                     ^~
Language: Java

import java.io.*;

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

	try{
	    BufferedReader br
		= new BufferedReader(new InputStreamReader(System.in));

	    System.out.print("S = ");
	    S = br.readLine();
	    

	} catch (Exception e) {
	    System.err.print("Error!");
	}

	if( S.length() == 2){
	    System.out.print(S);
	}

	else if( S.length() == 3){
	    S.charAt(1);
	    S.charAt(2);
	    S.charAt(3);
	    System.out.print(S.charAt(1) + S.charAt(2) + S.charAt(3));
	}
    }
}


Compiler output:
Main.java:19: error: variable S might not have been initialized
	if( S.length() == 2){
	    ^
1 error
Language: C++

#include <cstdlib>
#include <iostream>
 
int
main()
{
 
char str[128]= {}; ;
std::cin >> str;

if( str[2] == "\0"){
    std::cout << str
}
else{
    std::cout << str[2] << str<<[1] << str[0]<< std::endl;
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if( str[2] == "\0"){
      |     ~~~~~~~^~~~~~~
a.cc:12:21: error: expected ';' before '}' token
   12 |     std::cout << str
      |                     ^
      |                     ;
   13 | }
      | ~                    
a.cc:15:34: error: expected identifier before numeric constant
   15 |     std::cout << str[2] << str<<[1] << str[0]<< std::endl;
      |                                  ^
a.cc: In lambda function:
a.cc:15:37: error: expected '{' before '<<' token
   15 |     std::cout << str[2] << str<<[1] << str[0]<< std::endl;
      |                                     ^~
Language: C++

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

main(){
  string s;
  cin >> s;
  if (s.size()==3) swap(s[0],s[2];
  cout << s << endl;
}


Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:34: error: expected ')' before ';' token
    9 |   if (s.size()==3) swap(s[0],s[2];
      |                        ~         ^
      |                                  )
Language: C++

#include<cmath>
#include<algorithm> 
#include<map>
#include<queue>
using namespace std;
int main()
{
	char a[5];
	scanf("%s",&a);
	int n;
	n=strlen(a);
   if(n==2)
   	   {
   	   	   printf("%s\n",a);
	   }
	   if(n==3)
	   {
	   	   for(int i=3;i>=0;i--)
		   {
          printf("%c",a[i]);
	       }
	       printf("\n");
	   }
	   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
    9 |         scanf("%s",&a);
      |         ^~~~~
a.cc:11:11: error: 'strlen' was not declared in this scope
   11 |         n=strlen(a);
      |           ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<queue>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc:14:20: error: 'printf' was not declared in this scope
   14 |                    printf("%s\n",a);
      |                    ^~~~~~
a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    4 | #include<queue>
  +++ |+#include <cstdio>
    5 | using namespace std;
a.cc:20:11: error: 'printf' was not declared in this scope
   20 |           printf("%c",a[i]);
      |           ^~~~~~
a.cc:20:11: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:22:16: error: 'printf' was not declared in this scope
   22 |                printf("\n");
      |                ^~~~~~
a.cc:22:16: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <cstdlib>
#include <iostream>
 
int
main()
{
 
char str[128]= {}; ;
std::cin >> str;

if( str[2] = "\0"){
    std::cout << str
}
else{
    std::cout << str[2] << str<<[1] << str[0]
}
  return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   11 | if( str[2] = "\0"){
      |              ^~~~
      |              |
      |              const char*
a.cc:12:21: error: expected ';' before '}' token
   12 |     std::cout << str
      |                     ^
      |                     ;
   13 | }
      | ~                    
a.cc:15:34: error: expected identifier before numeric constant
   15 |     std::cout << str[2] << str<<[1] << str[0]
      |                                  ^
a.cc: In lambda function:
a.cc:15:37: error: expected '{' before '<<' token
   15 |     std::cout << str[2] << str<<[1] << str[0]
      |                                     ^~
a.cc: In function 'int main()':
a.cc:15:46: error: expected ';' before '}' token
   15 |     std::cout << str[2] << str<<[1] << str[0]
      |                                              ^
      |                                              ;
   16 | }
      | ~
Language: Java

import java.util.Scanner;

public class ReverseString { 
   
  public static void main (String args[]){ 
	  String a[]=new String[10];
	  System.out.println("请输入字符串:");
	  Scanner sc=new Scanner(System.in);
	  for(int i=0;i<=a.length-1;i++){
		  a[i]=sc.next();
	  }
	  if(a.length==1)
		  System.out.println(a[0]+a[1]);
	  else {
		  for(int i=a.length-1;i<=0;i--)System.out.println(a[i]);
	  }
    } 
}

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

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

int main(){
string a;
cin >>a;
if(a.size()%2){
a.reverse();
cout << a << endl;
return 0;
}
cout <<a << endl;
return 0;
}

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

#include <cstdlib>
#include <iostream>
 
int
main()
{
 
char str[128];
cin >> str;

if( str.length() = 2){
    std:cout << str
}
else{
    std:cout << str[2] << str<<[1] << str[0]
}
  return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin >> str;
      | ^~~
      | std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:9: error: request for member 'length' in 'str', which is of non-class type 'char [128]'
   11 | if( str.length() = 2){
      |         ^~~~~~
a.cc:12:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     std:cout << str
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:5: error: duplicate label 'std'
   15 |     std:cout << str[2] << str<<[1] << str[0]
      |     ^~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     std:cout << str[2] << str<<[1] << str[0]
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:33: error: expected identifier before numeric constant
   15 |     std:cout << str[2] << str<<[1] << str[0]
      |                                 ^
a.cc: In lambda function:
a.cc:15:36: error: expected '{' before '<<' token
   15 |     std:cout << str[2] << str<<[1] << str[0]
      |                                    ^~
Language: C++

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

int main(){
string a;
cin >>a;
if(a.size()%2){
reverse(a);
cout << a << endl;
return 0;
}
cout <<a << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: no matching function for call to 'reverse(std::string&)'
    8 | reverse(a);
      | ~~~~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: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:
/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: Java

import java.io.*;

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

	try{
	    BufferedReader br
		= new BufferedReader(new InputStreamReader(System.in));

	    System.out.print("S = ");
	    S = br.readLine();
	    

	} catch (Exception e) {
	    System.err.print("Error!");
	}

	if(S.length() == 2){
	    System.out.print(S);
	}

	else if( S.length() == 3){
	    S.charAt(1);
	    S.charAt(2);
	    S.charAt(3);
	    System.out.print(S.charAt(1) + S.charAt(2) + S.charAt(3));
	}
    }
}


Compiler output:
Main.java:19: error: variable S might not have been initialized
	if(S.length() == 2){
	   ^
1 error
Language: Java

import java.io.*;

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

	try{
	    BufferedReader br
		= new BufferedReader(new InputStreamReader(System.in));

	    System.out.print("S = ");
	    buf = br.readLine();
	    S = Integer.parse(buf);

	} catch (Exception e) {
	    System.err.print("Error!");
	}

	if(S.length() == 2){
	    System.out.print(S);
	}

	else if( S.length() == 3){
	    S.charAt(1);
	    S.charAt(2);
	    S.charAt(3);
	    System.out.print(S.charAt(1) + S.charAt(2) + S.charAt(3));
	}
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
	    S = Integer.parse(buf);
	               ^
  symbol:   method parse(String)
  location: class Integer
1 error
Language: Java

import java.io.*;

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

	try{
	    BufferedReader br
		= new BufferedReader(new InputStreamReader(System.in));

	    System.out.print("S = ");
	    buf = br.readLine();
	    S = Integer.parse(buf);

	} catch (Exception e) {
	    System.err.print("Error!");
	}

	if(S.length() == 2){
	    System.out.print(S);
	}

	else if( S.length() == 3){
	    S.charAt(1);
	    S.charAt(2);
	    S.charAt(3);
	    System.out.print(S.charAt(1) + S.charAt(2) + S.charAt(3));
	}
    }
}


Compiler output:
Main.java:12: error: cannot find symbol
	    buf = br.readLine();
	    ^
  symbol:   variable buf
  location: class Main
Main.java:13: error: cannot find symbol
	    S = Integer.parse(buf);
	                      ^
  symbol:   variable buf
  location: class Main
2 errors
Language: C++

#include<iostream>
using namespace std;

int main(){
string a;
cin >>a;
if(a.size()%2){
a.reverse();
cout << a << endl;
return 0;
}
cout <<a << endl;
return 0;
}

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

#include <iostream>
#include<string>
using namespace std;
int main()
{
	string S;
	cin >> S;
	if (S.size() == 2) {
		cout << S;
	}
	else {
		reverse(S.begin(), S.end());
		cout << S<<endl;
	}
	return 0;

}


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

#include "pch.h"
#include <iostream>
#include<string>
using namespace std;
int main()
{
	string S;
	cin >> S;
	if (S.size() == 2) {
		cout << S;
	}
	else {
		reverse(S.begin(), S.end());
		cout << S<<endl;
	}
	return 0;

}


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

#include<iostream>
using namespace std;

int main(){
string a;
cin >>a;
if(a.size()%2){
reverse(a);
cout << a << endl;
return 0;
}
cout <<a << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'reverse' was not declared in this scope
    8 | reverse(a);
      | ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
string a;
cin >>a;
if(a%2){
reverse(a);
cout << a << endl;
return 0;
}
cout <<a << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
    7 | if(a%2){
      |    ~^~
      |    | |
      |    | int
      |    std::string {aka std::__cxx11::basic_string<char>}
a.cc:8:1: error: 'reverse' was not declared in this scope
    8 | reverse(a);
      | ^~~~~~~
Language: C++

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

{
	char str[5];
	strlen(str)==2||strlen(str)==3;
	scanf("%s",str);
	if (strlen(str)==2)  printf("%s\n",str);
	if  (strlen(str)==3)  printf("%s\n",strrev(str));
	return 0;

}

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

#include<iostream>
using namespace std;

Int main(){
string a;
cin >>a;
if(a%2){
reverse(a);
cout << a << endl;
return 0;
}
cout <<a << endl;
return 0;
}

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

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

int main(void)
{
     char str[4];
     char a;
     char b;
     char c;
     int i,d;

	scanf("%s", str);

     i = strlen(str);

	if(i==2){
     d=1;
     printf("%s",str);
	}

     if(i==3 && d=!1){
     a=str[0];
     b=str[1];
     c=str[2];
     printf("%s%s%s",c,b,a);
	}
     return 0;

}

Compiler output:
main.c: In function 'main':
main.c:21:18: error: lvalue required as left operand of assignment
   21 |      if(i==3 && d=!1){
      |                  ^
Language: C++

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

int main()
{
	char n[3];
	
    // 整数の入力
    scanf("%s", n);
	std::string str = n;

	if(str.length() == 3){
		auto temp = str[2];
		str[2] = str[0];
		str[0] = temp;
	}

    // 出力
    printf("%s\n", temp.c_str());
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 'temp' was not declared in this scope; did you mean 'tm'?
   19 |     printf("%s\n", temp.c_str());
      |                    ^~~~
      |                    tm
Language: Java

import java.util.Scanner;

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

	System.err.print("S = ");
	S = sc.next();
	
	if( S.length() == 2){
	    System.out.print(S);
	}

	else if( S.length() == 3){
	    S.charAt(1);
	    S.charAt(2);
	    S.charAt(3);
	    System.out.print(S.charAt(1) + S.charAt(2) + S.charAt(3));
	}
	else{
	    System.out.print("Error!");
	}
    }
}


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

#include<stdio.h>
#include<cstring>
using namespace std;
int main()

{
	char str[5];
	strlen(str)==2||strlen(str)==3;
	scanf("%s",str);
	if (strlen(str)==2) printf("%s\n",str);
	if  (strlen(str)==3) printf("%s\n",strrev(str));
	return 0;

}

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

#include <iostream>
#include<string>
using namespace std;
int main()
{
	string a;
	cin >> a;
	if (a.size() == 2) {
		cout << a;
	}
	else {
		reverse(a.begin(), a.end());
		cout << a;
	}
 
 
}

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

import java.util.Scanner;
public class test {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	String text = sc.nextLine();
    	if (text.length() == 2) {
    		System.out.println(text);
    	} else {
    		StringBuffer sb = new StringBuffer(text);
    		System.out.println(sb.reverse());
    	}
    	sc.close();
    }
}

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 <string>

int main()
{
	std::string str;
	char n[3];
	
    // 整数の入力
    scanf("%s", n);
	str = n;

	if(str.length() == 3){
		auto temp = str[0];
		str[2] = str[0];
		str[0] = temp;
	}

    // 出力
    printf("%s\n", temp.c_str());
    return 0;
}

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

#include<stdio.h>
#include<cstring>
int main()

{
	char str[5];
	strlen(str)==2||strlen(str)==3;
	scanf("%s",str);
	if (strlen(str)==2) printf("%s\n",str);
	if  (strlen(str)==3) printf("%s\n",strrev(str));
	return 0;

}

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

	std::string str;
	char n[3];
	
    // 整数の入力
    scanf("%s", n);
	str = n;

	if(str.length() == 3){
		auto temp = str[0];
		str[2] = str[0];
		str[0] = temp;
	}

    // 出力
    printf("%s\n", temp.c_str());
    return 0;

Compiler output:
a.cc:1:14: error: 'string' in namespace 'std' does not name a type
    1 |         std::string str;
      |              ^~~~~~
a.cc:1:8: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 |         std::string str;
a.cc:5:10: error: expected constructor, destructor, or type conversion before '(' token
    5 |     scanf("%s", n);
      |          ^
a.cc:6:9: error: 'str' does not name a type
    6 |         str = n;
      |         ^~~
a.cc:8:9: error: expected unqualified-id before 'if'
    8 |         if(str.length() == 3){
      |         ^~
a.cc:15:11: error: expected constructor, destructor, or type conversion before '(' token
   15 |     printf("%s\n", temp.c_str());
      |           ^
a.cc:16:5: error: expected unqualified-id before 'return'
   16 |     return 0;
      |     ^~~~~~
Language: C++

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

int main() {
    string target;
    cin >> target;
    if (target.size() == 2)
    {
        cout << target << endl;
    }
    else if(target.size == 3)
    {
        string output(target.rbegin(), target.rend());
        cout << target << endl;
    }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: 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 |     else if(target.size == 3)
      |             ~~~~~~~^~~~
      |                        ()
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    char s[4],s0[2];
    cin>>s;
    if(strlen(s)==2)cout<<s<<endl;
    if(strlen(s)==3){
        s0[0]=s[2];
        s[2]=s[0];
        s[0]=s0[0];
        cout<<s<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'strlen' was not declared in this scope
    9 |     if(strlen(s)==2)cout<<s<<endl;
      |        ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cctype>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc:10:8: error: 'strlen' was not declared in this scope
   10 |     if(strlen(s)==3){
      |        ^~~~~~
a.cc:10:8: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:40: error: 'S' was not declared in this scope
    9 |                 else cout<<s[2]<<s[1]<<S[0]<<endl;
      |                                        ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before 's'
   13 |         temp = s[i]
      |                    ^
      |                    ;
   14 |         s[i] = s[s.length()-1-i];
      |         ~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char s[4],s0[2];
    cin>>s;
    int s1(char[] s);
    if(s1==2)cout<<s<<endl;
    if(s1==3){
        s0[0]=s[2];
        s[2]=s[0];
        s[0]=s0[0];
        cout<<s<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected ',' or '...' before 's'
    7 |     int s1(char[] s);
      |                   ^
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(s1==2)cout<<s<<endl;
      |        ~~^~~
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s1==3){
      |        ~~^~~
Language: Java

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


Compiler output:
Main.java:21: error: class, interface, enum, or record expected
import java.util.*;
^
1 error
Language: C

#include<stdio.h>
#include<cstring>
int main()
{
	char str[5];
	scanf("%s",str);
	if (strlen(str)==2) printf("%s\n",str);
	if (strlen(str)==3) printf("%s\n",strrev( str));
	return 0;

}

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

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char s[4],s0[2];
    long s1;
    cin>>s;
    s1=int strlen(s);
    if(s1==2)cout<<s<<endl;
    if(s1==3){
        s0[0]=s[2];
        s[2]=s[0];
        s[0]=s0[0];
        cout<<s<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected primary-expression before 'int'
    8 |     s1=int strlen(s);
      |        ^~~
Language: C

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

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

	scanf("%s", s);

     i = strlen(s);

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

}

Compiler output:
main.c: In function 'main':
main.c:16:37: error: expected ';' before '}' token
   16 |      printf("%s%s%s",s[2],s[1],s[0])
      |                                     ^
      |                                     ;
   17 |         }
      |         ~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char s[4],s0[2];
    long s1;
    cin>>s;
    s1=strlen(char[] s);
    if(s1==2)cout<<s<<endl;
    if(s1==3){
        s0[0]=s[2];
        s[2]=s[0];
        s[0]=s0[0];
        cout<<s<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected primary-expression before 'char'
    8 |     s1=strlen(char[] s);
      |               ^~~~
a.cc:8:8: error: 'strlen' was not declared in this scope
    8 |     s1=strlen(char[] s);
      |        ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<stdio.h>
#include<cstring>
int main()
{
	char str[5];
	scanf("%s",str);
	if (strlen(str)==2) printf("%s",str);
	if (strlen(str)==3) printf("%s",strrev( str));
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
    8 |         if (strlen(str)==3) printf("%s",strrev( str));
      |                                         ^~~~~~
      |                                         strsep
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    char s[4],s0[2];
    long s1;
    cin>>s;
    s1=strlen(s);
    if(s1==2)cout<<s<<endl;
    if(s1==3){
        s0[0]=s[2];
        s[2]=s[0];
        s[0]=s0[0];
        cout<<s<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'strlen' was not declared in this scope
   10 |     s1=strlen(s);
      |        ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cctype>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<csdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<map>
using namespace std
char a[];

int main(){
	if(str.len(a)==3){
		char e=a[1]
		a[1]=a[3];
		a[3]=e;
       for(i=1;i<=3;i++)
    		printf("%c",a[]);
    }
else 
    printf("%c%c",a[1],a[2]);
}


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

#include <iostream>
#include <string>

int main()
{
	std::string a;
	std::cin >> a;
	if (a.length() <= 2)
	{
		std::cout << a;
	}
	else
	{
		std::string b = "";
		for (int i = a.length - 1; i >= 0; i--)
		{
			b += a[i];
		}
		std::cout << b;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: 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 '()' ?)
   15 |                 for (int i = a.length - 1; i >= 0; i--)
      |                              ~~^~~~~~
      |                                      ()
Language: Java

import java.util.*;

class Main {
	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:7: error: illegal start of expression
		})else{
		 ^
Main.java:7: error: 'else' without 'if'
		})else{
		  ^
2 errors
Language: C++

#include<stdio.h>
#include<string.h>
int main(){
	char a[100];
	gets(a);
	if(strlen(a)<=2)
		puts(a);
		else{
		for(int i=strlen(a)-1;i>=0;i--)
			printf("%c",a[i]);
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    string s;
	cin >> s;
	if(s.size()==2)
		cout << s << endl;
	else if(s.size()==3){
		for(int i=2;i>=0;--i) 
			cout << s[i] ;
		cout << endl;
	}
}
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    string s;
	cin >> s;
	if(s.size()==2)
		cout << s << endl;
	else if(s.size()==3){
		for(int i=2;i>=0;--i) 
			cout << s[i] ;
		cout << endl;
	}
}


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

#include <iostream>
using namespace std;

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

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

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

Compiler output:
main.c: In function 'main':
main.c:9:20: error: expected ';' before '!' token
    9 |     for(i = 0; S[i] !- '/0'; ++i)
      |                    ^~
      |                    ;
main.c:9:24: warning: multi-character character constant [-Wmultichar]
    9 |     for(i = 0; S[i] !- '/0'; ++i)
      |                        ^~~~
main.c:12:18: error: 'J' undeclared (first use in this function)
   12 |       for(j = 0; J < 2; ++j){
      |                  ^
main.c:12:18: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

public class Main {
	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:5: error: illegal start of expression
		})else{
		 ^
Main.java:5: error: 'else' without 'if'
		})else{
		  ^
2 errors
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:5: error: no suitable constructor found for Scanner(no arguments)
        Scanner sc = new Scanner();
                     ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: Java

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: 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 <iostream>
#include <cmath>
#include<cstring>
#include<stdio.h>
#include<string.h>
using namespace std;


int main()
{
    char a[10];
    gets(a);
    int i;
    for(i = 0;i<10;i++)
    {
        if(a[i] == '\0')
            break;
    }
    if(i == 3)
    {
        for(i = 0;i<3;i++)
        {
            cout<<a[2-i];
        }
    }
    if(i == 2)
    {
        for(i = 0;i<2;i++)
        {
            cout<<a[i];
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

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


int main()
{
    char a[10];
    gets(a);
    int i;
    for(i = 0;i<10;i++)
    {
        if(a[i] == '\0')
            break;
    }
    if(i == 3)
    {
        for(i = 0;i<3;i++)
        {
            cout<<a[2-i];
        }
    }
    if(i == 2)
    {
        for(i = 0;i<2;i++)
        {
            cout<<a[i];
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |     gets(a);
      |     ^~~~
      |     getw
Language: C

#include<cmath>
#include<algorithm> 
#include<map>
#include<queue>
using namespace std;
int main()
{
	char a[5];
	scanf("%s",&a);
	int n;
	n=strlen(a);
   if(n==2)
   	   {
   	   	   printf("%s\n",a);
	   }
	   if(n==3)
	   {
	   	   for(int i=3;i>=0;i--)
		   {
          printf("%c",a[i]);
	       }
	       printf("\n");
	   }
	   return 0;
}

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

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

using namespace std;

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

	if (str.length() == 2){
		cout << str << endl;
	}

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


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

#include "pch.h"
#include <iostream>
#include<string>
using namespace std;
int main()
{
	string a;
	cin >> a;
	if (a.size() == 2) {
		cout << a;
	}
	else {
		reverse(a.begin(), a.end());
		cout << a;
	}


}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
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: In function 'int main()':
a.cc:9:28: error: expected ';' before 'cout'
    9 | reverse(s.begin(), s.end())
      |                            ^
      |                            ;
   10 | cout << s;
      | ~~~~
Language: Java

import javax.swing.JOptionPane; 
public class ReverseString { 
   
  public static void main (String args[]){ 
    String originalString; 
    String resultString = "";   
     
    originalString = JOptionPane.showInputDialog("Please input a String: "); 
     
    char[] charArray = originalString.toCharArray(); 
   
    for (int i=charArray.length-1; i>=0; i--){ 
      resultString += charArray[i]; 
    } 
     
    JOptionPane.showMessageDialog(null, resultString, "Reverse String", JOptionPane.INFORMATION_MESSAGE); 
  } 
}



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