Problem p02817 (C++)

Buggy submission (status: Runtime Error):
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//* vamsicool007    You are never wrong to do the right thing    vamsicool007 *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include <bits/stdc++.h>
using namespace std;
#define flash                                                                  \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define int long long
typedef long long ll;
typedef long double ld;
const int mod = 1000000007;
bool isPrime(ll n) {
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
ll factorial(ll n) { return (n == 1 || n == 0) ? 1 : n * factorial(n - 1); }
ll power(ll x, ll y) {
  ll res = 1;
  x = x;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res % mod;
}
ll ncr(ll n, ll r) {
  ll res = 1;
  if (r > n)
    return 0;
  if (r > n - r)
    r = n - r;
  for (ll i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
ll gcd(ll a, ll b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}
ll lcm(ll a, ll b) { return (a / gcd(a, b) * b); }
ll max(ll a, ll b) {
  ll ans = a > b ? a : b;
  return ans;
}
ll min(ll a, ll b) {
  ll ans = a < b ? a : b;
  return ans;
}

signed main() {
  flash;
#ifndef ONLINE_JUDGE
  freopen("infile.txt", "r", stdin);
  freopen("oufile.txt", "w", stdout);
#endif

  int t = 1;
  // cin>>t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    t.append(s);
    cout << t;
  }
  return 0;
}


Fixed submission:
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//* vamsicool007    You are never wrong to do the right thing    vamsicool007 *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include <bits/stdc++.h>
using namespace std;
#define flash                                                                  \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define int long long
typedef long long ll;
typedef long double ld;
const int mod = 1000000007;
bool isPrime(ll n) {
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
ll factorial(ll n) { return (n == 1 || n == 0) ? 1 : n * factorial(n - 1); }
ll power(ll x, ll y) {
  ll res = 1;
  x = x;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res % mod;
}
ll ncr(ll n, ll r) {
  ll res = 1;
  if (r > n)
    return 0;
  if (r > n - r)
    r = n - r;
  for (ll i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
ll gcd(ll a, ll b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}
ll lcm(ll a, ll b) { return (a / gcd(a, b) * b); }
ll max(ll a, ll b) {
  ll ans = a > b ? a : b;
  return ans;
}
ll min(ll a, ll b) {
  ll ans = a < b ? a : b;
  return ans;
}

signed main() {
  flash;
  int t = 1;
  // cin>>t;
  while (t--) {
    string s, t;
    cin >> s >> t;
    t.append(s);
    cout << t;
  }
  return 0;
}