エイシングプログラミングコンテスト2021(AtCoder Beginner Contest 202)
翻译中…
Problem Statement
翻译中…
You are given a string $S$ consisting of 0, 1, 6, 8, and 9.
翻译中…
Rotate $S$ $180$ degrees and print the result. In other words, apply the following operations on $S$ and print the resulting string:
翻译中…
- Reverse
$S$. - Replace each
0with a0, each1with a1, each6with a9, each8with an8, and each9with a6.
翻译中…
Constraints
翻译中…
$1 \leq |S| \leq 10^5$$S$consists of0,1,6,8, and9.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
S
翻译中…
Output
翻译中…
Print the result of rotating $S$ $180$ degrees.
翻译中…
样例
Input #1
0601889
Output #1
6881090
Rotating `0601889` $180$ degrees results in `6881090`.
Input #2
86910
Output #2
01698
Input #3
01010
Output #3
01010
$S$ may remain the same.
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。