Language: C++

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("inline")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#include <bits/stdc++.h>
#define int long long
#define double long double
#define x first
#define y second
#define yy cout<<"YES\n"
#define nn cout<<"NO\n"
#define rt return
#define ct continue
#define br break
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define mmod 1000000007
#define pmod 998244353
using namespace std;
int gcd(int a,int b){
    while (b) b^=a^=b^=a%=b;
    return a;
}
int lcm(int a,int b){
    return a*b/gcd(a,b);
}
int bigmod(int b,int p,int m){
    int ans=1;
    b%=m;
    if (!b) return 0;
    while (p){
        if (p&1) ans=(ans*b)%m;
        p>>=1;
        b=(b*b)%m;
    }
    return ans;
}
void recur(){
	
	
	
}
void solve(){
	string s;
	cin>>s;
	if (s.back()=='s') cout<<s<<"es";
	else cout<<s<<'s';
	
	
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while (t--) solve();
}

Compiler output:
a.cc:12:51: warning: bad option '-funsafe-loop-optimizations' to pragma 'optimize' [-Wpragmas]
   12 | #pragma GCC optimize("-funsafe-loop-optimizations")
      |                                                   ^
a.cc:29:20: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   29 | int gcd(int a,int b){
      |                    ^
a.cc:33:20: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   33 | int lcm(int a,int b){
      |                    ^
a.cc:36:29: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   36 | int bigmod(int b,int p,int m){
      |                             ^
a.cc:47:12: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   47 | void recur(){
      |            ^
a.cc:52:12: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   52 | void solve(){
      |            ^
a.cc:60:13: warning: bad option '-funsafe-loop-optimizations' to attribute 'optimize' [-Wattributes]
   60 | signed main(){
      |             ^
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:13:
/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
      |              ^~~~~~~~~~~~