22. Last Digit of the Bus Number

Acceptance 100% 1 accepted 1 submissions

Easy
BasicsMath
No companies listed
Bus conductors in Bengaluru often shout only the last digit of a bus number. Let's teach the computer to split a number.

Given a number n, print its last digit, and then the number that remains after removing that last digit.

Input Format
A single integer n.

Output Format
Print the last digit on the first line and the remaining number on the second line.

Constraints
• 0 ≤ n ≤ 10^9

Example 1

Input
1234
Output
4
123

Explanation Last digit is 4. Removing it leaves 123.

Example 2

Input
500
Output
0
50

Explanation Last digit is 0. Remaining number is 50.

Example 3

Input
7
Output
7
0

Explanation Last digit is 7. Nothing is left, so the remaining number is 0.

Acceptance 100%
Accepted 1
Submissions 1
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
4 123
No results yet
Run your code to test it against the sample cases.
Problem List