Page not loading? Try clicking here.
Placeholder

#1009

Number Reverse 1s 32MB

Problems

Write a program that, given a positive integer, prints the number in reverse and computes the sum of its digits.


Input

Each input is a positive integer not exceeding 2,100,000,000.

The input is guaranteed to be valid.

After each result, the program continues to accept new inputs until 0 is entered, which terminates the program.

At most 10 positive integers may be entered.


Output

For each input number, print the reversed number and the sum of its digits, separated by a space.

Do not print an invalid "0".

The reversed number will also not exceed 2,100,000,000.


Example #1

453

123456
0
354 12

654321 21

Example #2

10203040
3004000
54321
0
4030201 10
4003 7
12345 15


Source

정올모의고사

You must sign in to write code.