题解 AT3618 【Rotation】

2018-04-05 23:29:20


用C++的STL

#include<cstdio>
#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

//const int maxn(10086);

int main(){
    ios::sync_with_stdio(false); //输入输出优化
    string s1,s2;
    cin>>s1>>s2;
    reverse(s1.begin(),s1.end()); //将s1翻转
    if(s1==s2) printf("YES\n"); //若翻转后==s2则输出YES
    else printf("NO\n"); 
    return 0;
}