AT_abc476_a.Appender

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given a string SS consisting of lowercase English letters.

Output the string TT determined as follows.

  • If the last character of SS is e, TT is the string obtained by appending r to the end of SS.
  • If the last character of SS is not e, TT is the string obtained by appending er to the end of SS.

给你一个由小写英文字母组成的字符串 SS。

请输出按如下规则确定的字符串 TT:

  • 如果 SS 的最后一个字符是 e,则 TT 是在 SS 末尾添加 r 后得到的字符串;
  • 如果 SS 的最后一个字符不是 e,则 TT 是在 SS 末尾添加 er 后得到的字符串。

输入格式

The input is given from Standard Input in the following format:

SS

输入从标准输入中以如下格式给出:

SS

输出格式

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 TT 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 TT 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 TT to be outputted.

Constraints

  • SS is a string consisting of lowercase English letters.
  • The length of SS is between 11 and 1010, inclusive.

样例 1 解释:
live 的最后一个字符是 e,因此将 r 添加到 live 末尾所得的字符串 liver 即为要输出的字符串 TT。

样例 2 解释:
femur 的最后一个字符不是 e,因此将 er 添加到 femur 末尾所得的字符串 femurer 即为要输出的字符串 TT。

样例 3 解释:
chimpanzee 的最后一个字符是 e,因此将 r 添加到 chimpanzee 末尾所得的字符串 chimpanzeer 即为要输出的字符串 TT。

约束条件

  • SS 是一个仅由小写英文字母组成的字符串。
  • SS 的长度在 11 到 1010(含)之间。

输入解题思路,AI测评打分。不知道怎么写?

首页