102470: [AtCoder]ABC247 A - Move Right

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $100$ points

Problem Statement

There are $4$ squares lined up horizontally.

You are given a string $S$ of length $4$ consisting of 0 and 1.
If the $i$-th character of $S$ is 1, there is a person in the $i$-th square from the left;
if the $i$-th character of $S$ is 0, there is no person in the $i$-th square from the left.

Now, everyone will move to the next square to the right simultaneously. By this move, the person who was originally in the rightmost square will disappear.

Determine if there will be a person in each square after the move. Print the result as a string in the same format as $S$. (See also Sample Input / Output for clarity.)

Constraints

  • $S$ is a string of length $4$ consisting of 0 and 1.

Input

Input is given from Standard Input in the following format:

$S$

Output

Print a string of length $4$ such that the $i$-th character is 1 if there will be a person in the $i$-th square from the left after the move, and 0 otherwise.


Sample Input 1

1011

Sample Output 1

0101

After the move, the person who was originally in the $1$-st square will move to the $2$-nd square,
the person in the $3$-rd square to the $4$-th square,
and the person in the $4$-th square will disappear.


Sample Input 2

0000

Sample Output 2

0000

Sample Input 3

1111

Sample Output 3

0111

Input

题意翻译

给定一个 $ 4 $ 位的二进制串,求其右移一位之后的值的二进制。

Output

分数:100分 部分 问题描述 有4个方块水平排列。 你将得到一个长度为4的字符串S,由字符0和1组成。如果S的第i个字符为1,则从左数起的第i个方块中有一人;如果S的第i个字符为0,则从左数起的第i个方块中无人。 现在,每个人将同时移动到右边的下一个方块。通过这次移动,原来位于最右边方块的人将会消失。 确定移动后每个方块中是否有人。以与S相同的格式打印结果。(请参阅样例输入/输出以明确说明。) 部分 约束条件 S是一个长度为4的字符串,由字符0和1组成。 输入 输入格式如下: $S$ 输出 如果移动后从左数起的第i个方块中有人,则打印第i个字符为1,否则打印为0。 样例输入1 1011 样例输出1 0101 移动后,原来位于第1个方块的人将移动到第2个方块, 第3个方块中的人将移动到第4个方块, 第4个方块中的人将消失。 样例输入2 0000 样例输出2 0000 样例输入3 1111 样例输出3 0111

加入题单

上一题 下一题 算法标签: