Digit sum

Take an integer input, take the digit sum until one digit is left.
123456789->45->9
3264438924656432->71->8

IN

123456789

OUT

9

IN

3264438924656432

OUT

8

IN

86091795777214198982302874082228117380720385924328887730971212579342203308879143943429746338049565724

OUT

7

I think, there should be a restriction on accepting duplicate answers.

Sat Oct 24 03:04:23 2015


Leave a comment

Parsed as Markdown

Login to leave a comment