Problems
10035 - Make It One!
SUBMIT PROBLEM

Make It One!

Time Limit: 1 sec

 

The Problem

You are given an integer number N. Your task is to add all the digit of N until it becomes a one digit number.

Suppose, N = 583. Then, 5+8+3=16, as 16 is not a one digit number, add the digits again. 1+6=7, as 7 is a one digit number this is the answer.

 

The Input

Input contains one integer N per line. N will have 1 to 6 digits. Input ends by EOF.

 

The Output

For each line of input prints the case number and the answer. For the output format see the sample output.

 

Sample Input

583

57

135

286

 

Sample Output

Case #1: 7

Case #2: 3

Case #3: 9

Case #4: 7

 

 

 

[College Level]

1st Online Programming Contest 2016 by Outsbook

Problem Setter: Fahim Abrar