Problem4498--数字加密(二)

4498: 数字加密(二)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

给定一个四位数,加密规则如下:将每位数字分别加上 lns="http://www.w3.org/1998/Math/MathML">5(如果相加之后超过 lns="http://www.w3.org/1998/Math/MathML">9,则只保留除以 lns="http://www.w3.org/1998/Math/MathML">10 之后的余数),再将第一位数字与第四位数字交换,第二位数字与第三位数字交换。输出加密后的数字。

例如,输入 lns="http://www.w3.org/1998/Math/MathML">1234,则每一位分别加 lns="http://www.w3.org/1998/Math/MathML">5 后变成 lns="http://www.w3.org/1998/Math/MathML">6789,交换后变成 lns="http://www.w3.org/1998/Math/MathML">9876

Input

单个整数,表示输入的整数,保证是一个四位数,注意首位可能是 lns="http://www.w3.org/1998/Math/MathML">0

Output

单个整数,表示加密后的整数,应保证它是一个四位数,如果不足四位,首位用 lns="http://www.w3.org/1998/Math/MathML">0 补足。

Sample Input Copy

1234

Sample Output Copy

9876

Source/Category