A. 追加后缀 / Appender

    传统题 1000ms 256MiB

追加后缀 / Appender

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem Statement

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.

Constraints

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

Input

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

  • SS

Output

Output the answer.

live
liver

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.

femur
femurer

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.

chimpanzee
chimpanzeer

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.

ABC476 赛后模拟赛 ✅️

未参加
状态
已结束
规则
IOI
题目
7
开始于
2026-9-19 21:40
结束于
2026-10-10 21:40
持续时间
504 小时
主持人
参赛人数
35