Translation

Translation

题面翻译

题面描述

Berland 和 Birland 两地均有各自的语言,Berlandish 和 Birlandish。V 是一个翻译员,负责将 Berlandish 翻译成 Birlandish。将 Berlandish 翻译成 Birlandish 其实非常简单,只需把这个单词倒过来。比如单词code翻译过来就是edoc。但是粗心的 V 还是会犯一些错误。现在请你帮她判断一下他翻译的是否正确。

输入格式

两行,分别是一个 Berlandish 单词和 V 翻译的 Birlandish 单词。单词中所有字母均为小写拉丁字母(其实就是英文字母);单词长度均不超过 100 100 100 字符,单词中不包含任何多余空格。

输出格式

一行,如果 V 的翻译是正确的,输出YES。否则输出NO

题目描述

The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a little: it is spelled (and pronounced) reversely. For example, a Berlandish word code corresponds to a Birlandish word edoc. However, it’s easy to make a mistake during the «translation». Vasya translated word $ s $ from Berlandish into Birlandish as $ t $ . Help him: find out if he translated the word correctly.

输入格式

The first line contains word $ s $ , the second line contains word $ t $ . The words consist of lowercase Latin letters. The input data do not consist unnecessary spaces. The words are not empty and their lengths do not exceed 100 symbols.

输出格式

If the word $ t $ is a word $ s $ , written reversely, print YES, otherwise print NO.

样例 #1

样例输入 #1

code
edoc

样例输出 #1

YES

样例 #2

样例输入 #2

abb
aba

样例输出 #2

NO

样例 #3

样例输入 #3

code
code

样例输出 #3

NO

代码内容

// #include <iostream>
// #include <algorithm>
// #include <cstring>
// #include <stack>//栈
// #include <deque>//队列
// #include <queue>//堆/优先队列
// #include <map>//映射
// #include <unordered_map>//哈希表
// #include <vector>//容器,存数组的数,表数组的长度
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
    string x,y;
    cin>>x>>y;

    reverse(x.begin(),x.end());

    if(x==y) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    
    return 0;
}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Pretty Boy Fox

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值