daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Dec 14th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data = __import__("sys").stdin.readlines()
  2. def boucle(res):
  3.     resu = 0
  4.     for j in range(0,len(res)):
  5.         resu += int(res[j])
  6.     #print(resu)
  7.     if (resu > 9):
  8.         boucle(list(str(resu)))
  9.     else:
  10.         print(resu)
  11.        
  12.  
  13. n = len(data)
  14. for i in range(0,n-1):
  15.     res = list(data[i].replace("\n",''))
  16.     boucle(res)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top