AT_abc476_a.Appender
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a string S consisting of lowercase English letters.
Output the string T determined as follows.
- If the last character of S is
e, T is the string obtained by appendingrto the end of S. - If the last character of S is not
e, T is the string obtained by appendingerto the end of S.
给你一个由小写英文字母组成的字符串 S。
请输出按如下规则确定的字符串 T:
- 如果 S 的最后一个字符是
e,则 T 是在 S 末尾添加r后得到的字符串; - 如果 S 的最后一个字符不是
e,则 T 是在 S 末尾添加er后得到的字符串。
输入格式
The input is given from Standard Input in the following format:
S
输入从标准输入中以如下格式给出:
S
输出格式
Output the answer.
输出答案。
输入输出样例
输入#1
live
输出#1
liver
输入#2
femur
输出#2
femurer
输入#3
chimpanzee
输出#3
chimpanzeer
说明/提示
Sample 1 Explanation:
The last character of live is e, so the string liver, obtained by appending r to the end of live, is the string T to be outputted.
Sample 2 Explanation:
The last character of femur is not e, so the string femurer, obtained by appending er to the end of femur, is the string T to be outputted.
Sample 3 Explanation:
The last character of chimpanzee is e, so the string chimpanzeer, obtained by appending r to the end of chimpanzee, is the string T to be outputted.
Constraints
- S is a string consisting of lowercase English letters.
- The length of S is between 1 and 10, inclusive.
样例 1 解释:
live 的最后一个字符是 e,因此将 r 添加到 live 末尾所得的字符串 liver 即为要输出的字符串 T。
样例 2 解释:
femur 的最后一个字符不是 e,因此将 er 添加到 femur 末尾所得的字符串 femurer 即为要输出的字符串 T。
样例 3 解释:
chimpanzee 的最后一个字符是 e,因此将 r 添加到 chimpanzee 末尾所得的字符串 chimpanzeer 即为要输出的字符串 T。
约束条件
- S 是一个仅由小写英文字母组成的字符串。
- S 的长度在 1 到 10(含)之间。
输入解题思路,AI测评打分。不知道怎么写?