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

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

int main(){
    string S;
    string ans="s";

    cin >> S;

    if(S[S.size()-1] == "s"){
        ans = "es";
    }



    cout << S + ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(S[S.size()-1] == "s"){
Language: Java

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String word = in.next();
        if (word[-1] == "s") {
        	System.out.println(word + "es");
        } else {
        	System.out.println(word + "s");
        }
      	in.close();
    }
}

Compiler output:
Main.java:7: error: array required, but String found
        if (word[-1] == "s") {
                ^
1 error
Language: C++

/*版权所有，拷贝必究！*/
/*若想获得，请联系许希泉*/
#include<bits/stdc++.h>
#pragma GCC optimize("O999")
const int INF = 0x3f3f3f3f;
int maxn=5000005;
using namespace std;
struct node{

};
bool is_pal(string a)
{
    string s=a;
    reverse(s.begin(),s.end());
    if(s==a)
    return true;
    else
    return false;
}
bool is_prime(int n)
{
    if(n==1)
	return false;
    if(n==2||n==3)
	return true;
    if(n%6!=1&&n%6!=5)
	return false;
    for(register int i=5;i*i<=n;i+=6)
    if(n%i==0||n%(i+2)==0)
	return false;
    return true;
}
int main()
{
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(0);
	string s1,s2,s;
    int n,m,x,y,p,mut=1,sum=0,maxv=0,minv=1E5;
    cin>>s1;
    if(s1[s1.size()]!='s') 
    {
    	cout<<s1+='s';
	}
    else
    cout<<s1+="es";
    return 0;
}


Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:28:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   28 |     for(register int i=5;i*i<=n;i+=6)
      |                      ^
a.cc: In function 'int main()':
a.cc:43:17: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>' and 'char')
   43 |         cout<<s1+='s';
      |         ~~~~~~~~^~~~~
a.cc:46:13: error: no match for 'operator+=' (operand types are 'std::basic_ostream<char>' and 'const char [3]')
   46 |     cout<<s1+="es";
      |     ~~~~~~~~^~~~~~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    if (charAt.(S.length()) == 's') {
      System.out.println(S + "es");
    } else {
      System.out.println(S + "s");
    }
  }
}


Compiler output:
Main.java:7: error: <identifier> expected
    if (charAt.(S.length()) == 's') {
               ^
1 error
Language: C

#include<iostream>
#include<string.h>
using namespace std;
int main() {
	char s[10020];
	cin >> s;
	int len = strlen(s);
	if (s[len - 1] == 's') {
		s[len] = 'e';
		s[len + 1] = 's';
		s[len + 2] = '\0';
	}
	else {
		s[len] = 's';
		s[len + 1] = '\0';
	}
	cout << s << endl;
	return 0;
}

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

#include<iostream>
#include<string>

using namespace std;

int main(){
  char s[10001];
  cin >>s;
  int l = strlen(s);
  if(s[l-1]=='s'){
    cout<<s<<"es"<<endl;
  } else {
    cout <<s<<"s"<<endl;
  }
}


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

#include<iostream.h>
#include<bits/stdc++.h>

int main()
{
  string str;
  cin>>str;
  if(str[str.length()-1]!='s')
    str+="s";
  else
    str+="es";
  cout<<str;
}


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

#include<bits/stdc++.h>

using namespace std;

string s; 

int main()
{
	cin>>s;
	if(s[s.length()-1]=="s")
	{
		s=s+"es";
	}
	else
	{
		s=s+"s";
	}
	cout<<s;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(s[s.length()-1]=="s")
Language: Java

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String word = in.next();
        if (word[-1] == "s") {
        	System.out.println(word + "es");
        } else {
        	System.out.println(word + "s");
        }
      	in.close()
    }
}

Compiler output:
Main.java:12: error: ';' expected
      	in.close()
      	          ^
1 error
Language: C

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

int main(){
  char buf[1001];
  int	len = 0;
  
  	memset(buf, 0x00, sizeof(buf));
  
  	scanf("%s", bus);
  
  	len = strlen(bus);
  
  	if (buf[len-1] == 's' ) {
      printf("%ses", bus);
    } else {
      printf("%ss", bus);
    }
  
 	return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:10:21: error: 'bus' undeclared (first use in this function); did you mean 'buf'?
   10 |         scanf("%s", bus);
      |                     ^~~
      |                     buf
main.c:10:21: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args)throws Exception{
    Scanner sc=new Sanner(System.in);
    String S=sc.next();
    if(S+"s"){
      System.out.println(S+"es")
    }else{
      System.out.println(S+"s")
    }
  }
}


Compiler output:
Main.java:7: error: ';' expected
      System.out.println(S+"es")
                                ^
Main.java:9: error: ';' expected
      System.out.println(S+"s")
                               ^
2 errors
Language: C++

#include<iostream>
#include<string>
using namespace std;
 
int main(){string s;cin >> s;cout << s;if(s[s.length()-1]=='s'){cout << "es"}else{cout << "s"}}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:77: error: expected ';' before '}' token
    5 | int main(){string s;cin >> s;cout << s;if(s[s.length()-1]=='s'){cout << "es"}else{cout << "s"}}
      |                                                                             ^
      |                                                                             ;
a.cc:5:94: error: expected ';' before '}' token
    5 | int main(){string s;cin >> s;cout << s;if(s[s.length()-1]=='s'){cout << "es"}else{cout << "s"}}
      |                                                                                              ^
      |                                                                                              ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  if(S.size()-1== s) cout << S << "es" << endl;
  else cout << S << "s" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 's' was not declared in this scope
    7 |   if(S.size()-1== s) cout << S << "es" << endl;
      |                   ^
Language: Java

import java.util.*;
public class Singular {
    public static void main(String[] args) throws java.lang.Exception {
        Scanner sc =new Scanner (System.in);
        String s=sc.nextLine();
        int length=s.length();
        char c=s.charAt(length-1);
        if(Character.isLowerCase(c))
        {
            if(c=='s')
            {
                System.out.println(s+"es");
            }
            else{
                System.out.println(s+"s");
            }
        }
        sc.close();
    }
}


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

import java.util.*;
class sol
{
  public static void main(String[] args)
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    if(s.charAt(s.length()-1)=="s")
    {
      s=s+"es";
    }
    else
    {
      s=s+"s";
    }
    System.out.println(s);
  }
}


Compiler output:
Main.java:8: error: bad operand types for binary operator '=='
    if(s.charAt(s.length()-1)=="s")
                             ^
  first type:  char
  second type: String
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    if (charAt(S.length() - 1) == 's') {
      System.out.println(S + "es");
    } else {
      System.out.println(S + "s");
    }
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    if (charAt(S.length() - 1) == 's') {
        ^
  symbol:   method charAt(int)
  location: class Main
1 error
Language: C

str=input()
if str[-1]=='s':
    str+='es'
else:
    str+='s'
print(str)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | str=input()
      | ^~~
main.c:1:1: error: type defaults to 'int' in declaration of 'str' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | str=input()
      |     ^~~~~
main.c:1:5: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'if'
    2 | if str[-1]=='s':
      | ^~
main.c:3:10: warning: multi-character character constant [-Wmultichar]
    3 |     str+='es'
      |          ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string a;
  if(a.size()==3&&a[1]=='a'||'e'||'i'||'o'||'u')
    cout<<a<<"es"<<endl;
  else
    if(a[a.size()-1]==h&&a[a.size()-2]=='c'||'t'||'s')
      cout<<a<<"es"<<endl;
  else
    cout<<a<<"s"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'h' was not declared in this scope
    9 |     if(a[a.size()-1]==h&&a[a.size()-2]=='c'||'t'||'s')
      |                       ^
Language: C++

#include <string>

#include <iostream>

#include <stack>

#include <queue> // priority_queue も入ってる

#include <set>   // 要素数は size() で取得 multisetもある

#include <map>

#include <array> // sizeはコンパイル時定数で固定

#include <vector>

#include <numeric>   // accumulate, gcd

#include <algorithm> // count_ifに必要

#include <iomanip>   // cout << setprecision(15) << x で小数の出力精度を指定

#include <tuple>

#include <utility> //pair

#include <cmath>

#include <random>

using namespace std;

// 問題が起こるまでintは使用禁止2020-04-13

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)

template <class InputIterator, class T>

bool contains_itr(InputIterator iterator, const T &value)

{

    if (find(iterator.begin(), iterator.end(), value) == iterator.end())

        return false;

    else

        return true;

}

template <class T>

bool contains_set(set<T> st, const T &value)

{

    if (st.find(value) == st.end())

    {

        return false;

    }

    else

    {

        return true;

    }

}

template <class InputIterator>

auto sum(InputIterator iterator)

{

    return accumulate(iterator.begin(), iterator.end(), 0);

}

// endは排他的(exclusive)なので注意

vector<ll> range(ll begin, ll end)

{

    vector<ll> result;

    for (ll i = begin; i < end; ++i)

    {

        result.push_back(i);

    }

    return result;

}

random_device seed_gen;

mt19937 engine(seed_gen());

// 0, 1, 2 のどれかが得られる一様分布

// uniform_int_distribution<> dist(0, 2);

// cout << dist(engine) << endl;

// みたいに、先に確率分布を宣言して、そこにengineを与えて使う。

// =========ここまでテンプレ============

int main()
  {

    string s;

cin >> s;

if(s[s.size()-1])=='s')

  {

  s.push_back('e');

  }

s.push_back('s');

cout << s << endl;

   

 

    

  

   

    return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:130:18: error: expected primary-expression before '==' token
  130 | if(s[s.size()-1])=='s')
      |                  ^~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    string S;

    cin >> S;
    if (S[-1] == "s")
    {
        S += "s";
    }
    else
    {
        S += "es";
    }

    cout << S << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (S[-1] == "s")
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<string>
typedef long long ll;
typedef unsigned long long llu;
#define Q 1000000007

ll powmod(ll x, ll y) {
	ll res = 1;
	for (ll i = 0; i < y; i++) {
		res = res * x % Q;
	}
	return res;
}

int main() 
{
	char s[1002];

	scanf("%s", s);
	if (s[strlen(s)] == "s") {
		s[strlen(s) + 1] = "e";
		s[strlen(s) + 2] = "s";
	}
	else {
		s[strlen(s) + 1] = "s";
	}
	printf("%s\n", s);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'strlen' was not declared in this scope
   22 |         if (s[strlen(s)] == "s") {
      |               ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<string>
  +++ |+#include <cstring>
    5 | typedef long long ll;
Language: Java

class Main
{
	public static void main(String as[])
    {
		String a;
        Scanner sc=new Scanner(System.in);
      string es="es";
      String s="s";
      	a=sc.nextLine();
      if(a.charAt(a.length-1)==s)
      {
        a.charAt(a.length-1)='e';
        a+=s;
      }
      else
        a+=s;
      System.out.println(a);
    }
}


Compiler output:
Main.java:6: error: cannot find symbol
        Scanner sc=new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
        Scanner sc=new Scanner(System.in);
                       ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
      string es="es";
      ^
  symbol:   class string
  location: class Main
Main.java:10: error: cannot find symbol
      if(a.charAt(a.length-1)==s)
                   ^
  symbol:   variable length
  location: variable a of type String
Main.java:12: error: cannot find symbol
        a.charAt(a.length-1)='e';
                  ^
  symbol:   variable length
  location: variable a of type String
5 errors
Language: C++

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin >>s;
	if(s[s.length()-1])!='s')
      s+='s';
  	else if(s[s.length()-1])=='s')
      s+='es';
    cout <<s<<endl;
  
}

Compiler output:
a.cc:10:10: warning: multi-character character constant [-Wmultichar]
   10 |       s+='es';
      |          ^~~~
a.cc: In function 'int main()':
a.cc:7:28: error: expected primary-expression before '!=' token
    7 |         if(s[s.length()-1])!='s')
      |                            ^~
a.cc:9:33: error: expected primary-expression before '==' token
    9 |         else if(s[s.length()-1])=='s')
      |                                 ^~
Language: C++

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


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

     if (S[S.size() - 1]== "s"){
         S += "es";
     }else{
         S += "s";
     }
     cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'String' was not declared in this scope
    6 |     String S;
      |     ^~~~~~
a.cc:7:12: error: 'S' was not declared in this scope
    7 |     cin >> S;
      |            ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main()
{
  string s;
  cin >> s;
  
  char c='s',cc="es";
  int len=s.size();
  
  if(s[len-1]!='s')
    s+=c;
  else if(s[len-1]=='s')
    s+=cc;
    
    cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   11 |   char c='s',cc="es";
      |                 ^~~~
      |                 |
      |                 const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  if(S.size()-1=="s") cout << S << "es" << endl;
  else cout << S << "s" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if(S.size()-1=="s") cout << S << "es" << endl;
      |      ~~~~~~~~~~^~~~~
Language: C++

#include<stdio.h>
#include<malloc.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int i=0;
	char s[1005];
	gets(s);
	for(i=0;s[i]!='\0';i++);
	if(s[i-1]=='s')
	{
		s[i]='e';s[i+1]='s';s[i+2]='\0';
	}
	else
	{
		s[i]='s';s[i+1]='\0';
	}
	printf("%s",s);

}

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

#include<bits/stdc++.h>
using namespace std;
string s;
cin>>s;
int n=s.size();
if(s[i]!=115){
  cout<<s+"s"
}
else{
  cout<<s+"es"
}

Compiler output:
a.cc:4:1: error: 'cin' does not name a type
    4 | cin>>s;
      | ^~~
a.cc:6:1: error: expected unqualified-id before 'if'
    6 | if(s[i]!=115){
      | ^~
a.cc:9:1: error: expected unqualified-id before 'else'
    9 | else{
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
string a;
cin>>a;
int d;
for(int i=0;i<=a.size();i++)
{
  d+=0;
}
cout<<a[i];
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 | cout<<a[i];
      |         ^
Language: Java

import java.util.Scanner

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        String word = in.next();
        if (word[-1] == "s") {
        	System.out.println(word + "es");
        } else {
        	System.out.println(word + "s");
        }
    }
}

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

str=input()
if str[-1]=s:
    str+=es
else:
    str+=s
print(str)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | str=input()
      | ^~~
main.c:1:1: error: type defaults to 'int' in declaration of 'str' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | str=input()
      |     ^~~~~
main.c:1:5: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'if'
    2 | if str[-1]=s:
      | ^~
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
    int N;
    cin >> S >> T;
    int count;
    int maxCount = 0;
    string subString;
    for(int i = 0; i <= S.size() - T.size(); ++i){
        count = 0;
        for(int j = 0; j < T.size(); ++j) {
            if(S[i + j] == T[j]) {
                count++;
            }
        }
        maxCount = max(count, maxCount);
    }
    cout << T.size() - maxCount << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'S' was not declared in this scope
   15 |     cin >> S >> T;
      |            ^
a.cc:15:17: error: 'T' was not declared in this scope
   15 |     cin >> S >> T;
      |                 ^
Language: Java

class sol
{
  public static void main(String[] args)
  {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    if(s.charAt(s.length()-1)=="s")
    {
      s=s+"es";
    }
    else
    {
      s=s+"s";
    }
    System.out.println(s);
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scanner sc=new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class sol
Main.java:5: error: cannot find symbol
    Scanner sc=new Scanner(System.in);
                   ^
  symbol:   class Scanner
  location: class sol
Main.java:7: error: bad operand types for binary operator '=='
    if(s.charAt(s.length()-1)=="s")
                             ^
  first type:  char
  second type: String
3 errors
Language: C++

#include<bits/stdc++.h>
#define REP(i,N) for (int i=0;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

int main(){
    string S;
    cin >> S;
    string out;
    int a;
    a=S.size()
    if (S[a-1] =="s"){
        out=S+'es'
    }else{
        out=S+'s'
    }
    cout << out <<endl;
}

Compiler output:
a.cc:18:15: warning: multi-character character constant [-Wmultichar]
   18 |         out=S+'es'
      |               ^~~~
a.cc: In function 'int main()':
a.cc:16:15: error: expected ';' before 'if'
   16 |     a=S.size()
      |               ^
      |               ;
   17 |     if (S[a-1] =="s"){
      |     ~~         
a.cc:19:6: error: 'else' without a previous 'if'
   19 |     }else{
      |      ^~~~
a.cc:20:18: error: expected ';' before '}' token
   20 |         out=S+'s'
      |                  ^
      |                  ;
   21 |     }
      |     ~
Language: C++

#include<stdio.h>
#include<malloc.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
	int i;
	char s[1003];
	gets(s);
	for(i=0;s[i]!='\0';i++);
	if(s[i-1]=='s')
	{
		s[i]='e';s[i+1]='s';s[i+2]='\0';
	}
	else
	{
		s[i]='s';s[i+1]='\0';
	}
	puts(s);

}

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

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    if (charAt(S.length()) == 's') {
      System.out.println(S + "es");
    } else {
      System.out.println(S + "s");
    }
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    if (charAt(S.length()) == 's') {
        ^
  symbol:   method charAt(int)
  location: class Main
1 error
Language: C++

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

int main(){
  	string s;
  	cin>>s;
  	int n=A.length();
  	if(s[n-1]=='s')
      	cout<<s+"es";
  	else
      	cout<<s+"s";
 	return 0; 
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:5:9: 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:6:9: 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:6:14: error: 's' was not declared in this scope
    6 |         cin>>s;
      |              ^
a.cc:7:15: error: 'A' was not declared in this scope
    7 |         int n=A.length();
      |               ^
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |         cout<<s+"es";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         cout<<s+"s";
      |         ^~~~
      |         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 <iostream>
#include <string>
using namespace std; 
  
int main(){
  string s;
  cin>>s;
  int n = s.length();
  if(s[n-1] == 's'){
    s += "es"
  }
  else
    s += "s";
  cout<<s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before '}' token
   10 |     s += "es"
      |              ^
      |              ;
   11 |   }
      |   ~
Language: C

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

int main() {
  string S;
  cin >> S;
  int num = S.size();
  if(S[num-1] == 's'){
    S.push_back('e');
    S.push_back('s');
  }else{
    S.push_back('s');
  }
  cout << S;
  return 0;
}

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

#include <string>

#include <iostream>

#include <stack>

#include <queue> // priority_queue も入ってる

#include <set>   // 要素数は size() で取得 multisetもある

#include <map>

#include <array> // sizeはコンパイル時定数で固定

#include <vector>

#include <numeric>   // accumulate, gcd

#include <algorithm> // count_ifに必要

#include <iomanip>   // cout << setprecision(15) << x で小数の出力精度を指定

#include <tuple>

#include <utility> //pair

#include <cmath>

#include <random>

using namespace std;

// 問題が起こるまでintは使用禁止2020-04-13

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)

template <class InputIterator, class T>

bool contains_itr(InputIterator iterator, const T &value)

{

    if (find(iterator.begin(), iterator.end(), value) == iterator.end())

        return false;

    else

        return true;

}

template <class T>

bool contains_set(set<T> st, const T &value)

{

    if (st.find(value) == st.end())

    {

        return false;

    }

    else

    {

        return true;

    }

}

template <class InputIterator>

auto sum(InputIterator iterator)

{

    return accumulate(iterator.begin(), iterator.end(), 0);

}

// endは排他的(exclusive)なので注意

vector<ll> range(ll begin, ll end)

{

    vector<ll> result;

    for (ll i = begin; i < end; ++i)

    {

        result.push_back(i);

    }

    return result;

}

random_device seed_gen;

mt19937 engine(seed_gen());

// 0, 1, 2 のどれかが得られる一様分布

// uniform_int_distribution<> dist(0, 2);

// cout << dist(engine) << endl;

// みたいに、先に確率分布を宣言して、そこにengineを与えて使う。

// =========ここまでテンプレ============

int main()


    string s;

cin >> s;

if(s[s.size()-1])=='s')
  {
  s.push_back('e');
  }
s.push_back('s');

cout << s << endl;

   

 




    

  

   









    return 0;

}



Compiler output:
a.cc:126:5: error: expected initializer before 'string'
  126 |     string s;
      |     ^~~~~~
a.cc:128:1: error: 'cin' does not name a type
  128 | cin >> s;
      | ^~~
a.cc:130:1: error: expected unqualified-id before 'if'
  130 | if(s[s.size()-1])=='s')
      | ^~
a.cc:134:1: error: 's' does not name a type
  134 | s.push_back('s');
      | ^
a.cc:136:1: error: 'cout' does not name a type
  136 | cout << s << endl;
      | ^~~~
a.cc:159:5: error: expected unqualified-id before 'return'
  159 |     return 0;
      |     ^~~~~~
a.cc:161:1: error: expected declaration before '}' token
  161 | }
      | ^
Language: C

#include <bits/stdc++.h>
#define ll long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define lc "\n"
#define forr(i,a,n)  for(ll i=a;i<n;i++)
using namespace std;

int main()
{
    IOS;
    string s;
    cin>>s;

    int x=s.size();

       if(s[x-1]=='s' ){s+="es";}
       else {s+="s";}


   cout<<s;
    return 0;
}


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

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin >>s;
	if(s[s.length()-1]!='s')
      s+='s';
  	else if(s[s.length()-1)=='s')
      s+='es';
    cout <<s<<endl;
  return 0;
}

Compiler output:
a.cc:10:10: warning: multi-character character constant [-Wmultichar]
   10 |       s+='es';
      |          ^~~~
a.cc: In function 'int main()':
a.cc:9:31: error: expected ']' before ')' token
    9 |         else if(s[s.length()-1)=='s')
      |                               ^
      |                               ]
a.cc:9:32: error: expected primary-expression before '==' token
    9 |         else if(s[s.length()-1)=='s')
      |                                ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int l=s.size();
  if(s[l-1]=='s')
  {
    s+='e';
    s+='s';
  }
  else
  {
    s+='s'
  }
  cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: expected ';' before '}' token
   15 |     s+='s'
      |           ^
      |           ;
   16 |   }
      |   ~
Language: C++

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

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

  if (x(x.size()-1) != 's') {
    cout << x << "s" << endl;
  }

  if (x(x.size()-1) = 's') {
    cout << x << "es" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::__cxx11::basic_string<char>::size_type)'
    8 |   if (x(x.size()-1) != 's') {
      |       ~^~~~~~~~~~~~
a.cc:12:8: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (std::__cxx11::basic_string<char>::size_type)'
   12 |   if (x(x.size()-1) = 's') {
      |       ~^~~~~~~~~~~~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.nextLine();
    if (charAt(S.length()) == s) {
      System.out.println(S + "es");
    } else {
      System.out.println(S + "s");
    }
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    if (charAt(S.length()) == s) {
        ^
  symbol:   method charAt(int)
  location: class Main
Main.java:7: error: cannot find symbol
    if (charAt(S.length()) == s) {
                              ^
  symbol:   variable s
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string str;
  cin>>str;
  cout<<str;
  if(str.at(str.size()-1)=="s")
    	cout<<"es"<<endl;
  else
    	cout<<"s"<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if(str.at(str.size()-1)=="s")
      |      ~~~~~~~~~~~~~~~~~~~~^~~~~
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
int main
{
	char s[1001];
    cin>>s;
    if(s[strlen(s)-1]=='s') printf("%s,es",s);
    else printf("%s,s",s);
    return 0;
}

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main
      |     ^~~~
a.cc:6:9: error: expected primary-expression before 'char'
    6 |         char s[1001];
      |         ^~~~
a.cc:6:9: error: expected '}' before 'char'
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
a.cc:7:5: error: 'cin' does not name a type
    7 |     cin>>s;
      |     ^~~
a.cc:8:5: error: expected unqualified-id before 'if'
    8 |     if(s[strlen(s)-1]=='s') printf("%s,es",s);
      |     ^~
a.cc:9:5: error: expected unqualified-id before 'else'
    9 |     else printf("%s,s",s);
      |     ^~~~
a.cc:10:5: error: expected unqualified-id before 'return'
   10 |     return 0;
      |     ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{string s,plural;
 cin>>s;
 if(s[s.legth()-1]=='s')
   plural=s+"es";
 else
   plural=s+'s';
 cout<<plural;
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legth'; did you mean 'length'?
    6 |  if(s[s.legth()-1]=='s')
      |         ^~~~~
      |         length
Language: C++

#include <bits/stdc++.h>
int main()
{
  string s;
  cin>>s;int y=s.size()
  if(s[y-1]='s')
    s+="es";
  else
    s+='s';
  cout<<s;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:4:3: 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:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>s;int y=s.size()
      |   ^~~
      |   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:8: error: 's' was not declared in this scope
    5 |   cin>>s;int y=s.size()
      |        ^
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else
      |   ^~~~
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout<<s;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

//package atcoder.beginnercontest.r179;

import java.util.Scanner;

public class PluralForm {

  public static void main(String[] args) {
    try (Scanner sc = new Scanner(System.in)) {
      String s = sc.next();
      if (s.endsWith("s"))
        s += "e";
      System.out.println(s + "s");
    }
  }
}


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

#include <bits/stdc++.h> 
using namespace std; 
  
int main(){
  string s;
  cin>>s;
  int n = s.length();
  if(s[n-1] == 's'){
    s += "es"
  }
  else
    s += "s";
  cout<<s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before '}' token
    9 |     s += "es"
      |              ^
      |              ;
   10 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,l,r) for(int i=l;i<r;i++)
using ll = long long;
const int inf=2e9+10;
const ll MOD=1e9+7;
const ll INF=9e18+10;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

int main(){
        string s;cin>>s;
        cout<<s;
        if(s.[s.size()-1]=='s')cout<<"e";
        cout<<endl;
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected unqualified-id before '[' token
   15 |         if(s.[s.size()-1]=='s')cout<<"e";
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define e endl
int main()
{
    ll a,b,c,t,i;
    char s[100];
    gets(s);
    a=strlen(s);

        if(s[a-1]=='s'){cout<<s;cout<<"es";}
        else {cout<<s;cout<<"s";}


}


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

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define black_tree tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define pair_black_tree tree<pair<ll,ll>,null_type,less<pair<ll,ll> >,rb_tree_tag,tree_order_statistics_node_update>
#define gp __gnu_pbds
#define INF 1000000000
#define MOD 1000000007
#define MAX 1000001
#define endl '\n'
#define ll long long
#define ld long double
#define lli long long int
#define ull unsigned long long
#define ulli unsigned long long int
#define pb push_back
#define pf push_front
#define ook order_of_key
#define fbo find_by_order
#define np next_permutation
#define mp make_pair
#define eb emplace_back
#define mae max_element
#define mie min_element
#define lb lower_bound 
#define ub upper_bound
#define bs binary_search
#define ff first
#define ss second
using namespace std;
using namespace gp;
string s;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>s;
    char c=s[s.size()-1];
    if(c=='s'){
    	cout<<s<<"es";
	}
	else{
		cout<<s<<"s";
	}
}

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:3:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
  {
  string H; 
  cin>>H;
  if(H[H.length()])==s)
    {
    cout<<H+"es";
    }
  else{
    cout<<H+'s';
  }
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected primary-expression before '==' token
    7 |   if(H[H.length()])==s)
      |                    ^~
a.cc:7:22: error: 's' was not declared in this scope
    7 |   if(H[H.length()])==s)
      |                      ^
Language: C++

#include <iostream>
#include <string>
int main()
{
  string s;int l;
  cin >>s;
  l=s.length();
  if(s[l-1]=='s')
    cout <<s<<"es";
  else
    cout <<s<<"s";
}

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

using namespace std;

int main(void)
{
    String s;
    cin>>s;
    int len = s.length();
    if(s[len-1]=='s')
    {
        cout<<s<<"es\n";
    }
    else
    {
        cout<<s<<"s\n";
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'String' was not declared in this scope
    8 |     String s;
      |     ^~~~~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s;
      |          ^
Language: C++

#include <cstdio>
#include <cstring>

int main() {
    char s[1010];
    gets(s);
    int len = strlen(s) - 1;
    if (s[len] == 's') printf("%ses", s);
    else printf("%ss", s);
    return 0;
}

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

#include<stdio.h>
#include<string.h>
int main()
{
  char s[5000];
  scanf("%s",s);
  int n=strlen(s);
  if(s[n-1]=='s')
  {
    printf("%s",s);
    printf("es");
  }else{
    printf("%s",s);
    printf("s");
  }
  returun 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'returun' was not declared in this scope
   16 |   returun 0;
      |   ^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
string s;
int main()
{
  cin>>s;
  int n=s.length();
  if(s[n-1]=='s')
    s+='es';
	,cout<<s;
  else s+='s',cout<<s;
  return 0;
}

Compiler output:
a.cc:12:8: warning: multi-character character constant [-Wmultichar]
   12 |     s+='es';
      |        ^~~~
a.cc: In function 'int main()':
a.cc:12:8: warning: overflow in conversion from 'int' to 'char' changes value from '25971' to '115' [-Woverflow]
a.cc:13:9: error: expected primary-expression before ',' token
   13 |         ,cout<<s;
      |         ^
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else s+='s',cout<<s;
      |   ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
string s;
int main()
{
  cin>>s;
  int n=s.lengh();
  if(s[n-1]=='s')
    s+='es';
	,cout<<s;
  else s+='s',cout<<s;
  return 0;
}

Compiler output:
a.cc:12:8: warning: multi-character character constant [-Wmultichar]
   12 |     s+='es';
      |        ^~~~
a.cc: In function 'int main()':
a.cc:10:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lengh'; did you mean 'length'?
   10 |   int n=s.lengh();
      |           ^~~~~
      |           length
a.cc:12:8: warning: overflow in conversion from 'int' to 'char' changes value from '25971' to '115' [-Woverflow]
   12 |     s+='es';
      |        ^~~~
a.cc:13:9: error: expected primary-expression before ',' token
   13 |         ,cout<<s;
      |         ^
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else s+='s',cout<<s;
      |   ^~~~
Language: Java

import java.util.Scanner;

public class TaskA {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String word = in.next();
        int n = word.length();
        if (word.charAt(n-1) != 's')
            System.out.println(word + "s");
        else if (word.charAt(n-1) == 's')
            System.out.println(word + "es");
    }
}


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

import java.util.*;
public class Main
{
    public static Scanner sc = new Scanner(System.in);
	public static void main(String[]args)
    {
      String str = sc.next();
      int len = str.length();
      if(str.charAt(len-1)!='s')
      	System.out.println(str+'s');
      else
        System.out.println(str+'es');
    }
}


Compiler output:
Main.java:12: error: unclosed character literal
        System.out.println(str+'es');
                               ^
Main.java:12: error: unclosed character literal
        System.out.println(str+'es');
                                  ^
Main.java:12: error: not a statement
        System.out.println(str+'es');
                                 ^
3 errors
Language: C++

#include <bits/stdc++.h>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, s, n) for (int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define MOD 1000000007

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

    if(char(s[s.size()-1])=='s'){
        s=s+"es";
      cout<<s<<endl;
    }
    else{
        s=s+'s';
      cout<<s<<endl;
    }


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

#include<bits,stdc++.h>
using namespace std;
int main()
{
string s;
  cin>>s;
  int l;
  l=s.length();
  if(s[l-1]=='s')
  {
    s=s+'e';
  }
  
      s=s+'s';
  cout<<s<<endl;
}

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

#include<iostream>
#include<string>

using namespace std;

int main(void)
{
    String s;
    cin>>s;
    int len = s.length();
    if(s[len-1]=='s')
    {
        cout<<s<<'es\n';
    }
    else
    {
        cout<<s<<'s\n';
    }
    
    return 0;
}

Compiler output:
a.cc:13:18: warning: multi-character character constant [-Wmultichar]
   13 |         cout<<s<<'es\n';
      |                  ^~~~~~
a.cc:17:18: warning: multi-character character constant [-Wmultichar]
   17 |         cout<<s<<'s\n';
      |                  ^~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'String' was not declared in this scope
    8 |     String s;
      |     ^~~~~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s;
      |          ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected primary-expression before '<<' token
    7 | else cout<<s+<<"s";
      |              ^~
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
  char s[5000];
  scanf("%s",s);
  int n=strlen(s);
  if(s[n-1]==s)
  {
    printf("%s",s);
    printf("es");
  }else{
    printf("%s",s);
    printf("s");
  }
  returun 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(s[n-1]==s)
      |      ~~~~~~^~~
a.cc:16:3: error: 'returun' was not declared in this scope
   16 |   returun 0;
      |   ^~~~~~~
Language: C++

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



int main() {
  string S;
  cin >> S;
  reverse(S.begin(), S.end());
  if(S.at(0)== char s){cout << S+ "es" <<endl;}
  cout<< S+ "s" <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected primary-expression before 'char'
   10 |   if(S.at(0)== char s){cout << S+ "es" <<endl;}
      |                ^~~~
a.cc:10:15: error: expected ')' before 'char'
   10 |   if(S.at(0)== char s){cout << S+ "es" <<endl;}
      |     ~         ^~~~~
      |               )