問題一覧 > 通常問題

No.2314 Backflip

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 302
作問者 : 👑 amentorimaru / テスター : tatyam cleantted
お気に入りにしたユーザー ProblemId : 9208 / 自分の提出
問題文最終更新日: 2023-05-07 14:33:19
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 390 (順位表) の他の問題:

Problem Statement

Etowanyu, who lives in a virtual space, is playing with the Backflip emote. Isn't he cute?

You are given a string $S$ consisting only of $0$ and $1$. Output the string obtained by replacing the last character with $1$ if it is $0$, and with $0$ if it is $1$.

Input

$S$
  • $1 \le |S| \le 8$
  • $S$ is a string consisting only of $0$ and $1$

Output

Output the string after the replacement.

Sample

Sample 1
Input
100
Output
101

The last $1$ character of $100$ is $0$, so replace it with $1$ and output $101$.

Sample 2
Input
1
Output
0

Sample 3
Input
01001011
Output
01001010

Even if the most significant digit is $0$, do not remove it; output it as is.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。