Language: C++

//////////////////////////////////////
////       ABHINASH GIRI          ////
/////////////////////////////////////
#include<bits/stdc++.h>
using namespace std;
#define pr 4294967296   // 2^32
#define fast ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define high 1000000001
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             -1e18
#define pinf              1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define e               1000000000
#define w(x)            int t; cin>>t; while(t--)
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define co(x) cout<<(x)<<"\n"
#define endl "\n"
typedef unsigned long int  ul;
//typedef unsigned long long int ull;
typedef unsigned long long  int  li;
typedef vector<int> vi;
typedef vector<long long int> vll;
typedef vector<long int> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long int,long int>> vpl;
typedef vector<pair<long long int,long long int>> vpll;
typedef long long ll;
int phi(int n) {
    int res = n;
    for (int i = 2; (i*i) <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n /= i;
            res -= res / i;
        }
    }
    if (n > 1)
        res -= res / n;
    return res;
}
bool cmp(pair<int, int>a,pair<int, int>b)
{
    if(a.first==b.first)
    {return a.second< b.second;}
    return a.first<b.first;
}
struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode() : val(0), left(nullptr), right(nullptr) {}
    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
    TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
bool check(ll &x,ll &y,ll &i)
{
    return (x&i)==(y&i);
}
ll binary(ll &l,ll &r,ll &x,ll &y)
{
    ll ans=LLONG_MAX ,ma =1;
    while(l<=r)
    {
        ll mid = l + (r-l)/2;
        if(check(x,y,mid))
        {
            ans =min(ans,mid) ;
            r = mid-1;
        }else { l = mid+1;}
    }
    return ans;

}
void merge(long int arr[],li start,li mid , li end,long int &inv_count,li n)
{
    li i=start;li j=mid+1;li k=start;
    long int temp[n+1];
    memset(temp,0, sizeof(temp));
    while(i<=mid and j<=end)
    {
        if(arr[i]>arr[j])
        {
            inv_count+=(mid-i+1);
            temp[k++]=arr[j++];
        }
        if(arr[i]<arr[j])
        {
            temp[k++]=arr[i++];
        }
    }
    while(i<=mid)
    {
        temp[k++]=arr[i++];
    }
    while(j<=end)
    {
        temp[k++]=arr[j++];
    }
    //copying values to original array
    for (int l = start; l <=end; ++l)
    {
        arr[l]=temp[l];
    }

}
void merge_inv(long int arr[],li start,li end,long int &inv_count,li &n)
{
    if(start<end)
    {
        li mid = start + (end-start)/2;
        merge_inv(arr,start,mid,inv_count,n);
        merge_inv(arr,mid+1,end,inv_count,n);
        merge(arr,start,mid,end,inv_count,n);
    }

}
bool vis[200005];
li dfs(li i,li goes_to[])
{
    if(vis[i])
    {
        return 0;
    }
    vis[i]=true;
    li x = dfs(goes_to[i],goes_to);
    return (x+1);
}
long int no_of_transposition(li a[],li n,li goes_to[])
{
    memset(vis,false,sizeof(vis));
    li trans=0;
    for(auto i=1;i<=n;i++)
    {
        if(!vis[i])
        {
            li ans = dfs(i,goes_to);
            trans+=(ans-1);
        }
    }
    return trans;
}
int main() {
    std::chrono::time_point<std::chrono::high_resolution_clock> start_timer, end_timer;
    start_timer = std::chrono::high_resolution_clock::now();
    bool show_time = false;  //  change it to true when needed;
//    #ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
//    #endif

    /* Cook your Code  */
    fast;
  string s,t;
  cin>>s>>t;t.pop();
  if(s==t)
  {
    cout<<"YES\n";
  }
  else  cout<<"NO\n";
    end_timer = std::chrono::high_resolution_clock::now();
    ll elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(end_timer-start_timer).count();
    if(show_time)
    {cout << "\\nElapsed Time: " << elapsed_time << "ms\\n";}

    return 0;
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:162:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
  162 |   cin>>s>>t;t.pop();
      |               ^~~
a.cc: At global scope:
a.cc:176:1: error: expected declaration before '}' token
  176 | }
      | ^