UVA Sollution: 11332 - Summing Digits

//Problem Link : https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2307 n=input() while n!='0': ans=0 c=int(n) while c>9: ans=0 for i in n: ans=ans+int(i) n=str(ans) c=ans print(c) n=input()

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.