SHARE
TWEET

codeforce - translation

jakaria_hossain Apr 3rd, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. int main()
  5. {
  6.     fastread()
  7.     string x,y;
  8.     cin>>x>>y;
  9.     int a=x.size(),b=y.size();
  10.     bool flag= true;
  11.     if(a==b)
  12.     {
  13.         for(int i=0,j=a-1;i<a,j>=0;i++,j--)
  14.         {
  15.             if(x[i]!=y[j])
  16.             {
  17.                 flag= false;
  18.                 break;
  19.             }
  20.         }
  21.         if(flag)cout<<"YES"<<endl;
  22.         else cout<<"NO"<<endl;
  23.     }
  24.     else cout<<"NO"<<endl;
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top