Problem list
Log in
#r03099 · Online Judge > GoldOJ

Reverse and Digit Sum

Bronze II 2.0 s 256 MB

Given a natural number $N$, print $N$ written backwards (leading zeros of the reversed number are dropped) on the first line, and the sum of $N$'s digits on the second line.

Input

One integer $N$ ($1 \le N \le 10^6$).

Output

Print the reversed number, then the digit sum.

Example 1

Input
22
Output
22
4

Example 2

Input
1200
Output
21
3
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code