Advertisement
Thrashans

Cuenta ovejas

Aug 27th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. for j in range(int(input())):
  2.     ans = False
  3.     digits = [False] * 10
  4.     n = int(input())
  5.     if n == 0:
  6.         print('INSOMNIO')
  7.         continue
  8.     i = 1
  9.     while(ans == False):
  10.         num = str(i * int(n))
  11.         for c in num:
  12.             x = int(c)
  13.             if digits[x] == False:
  14.                 digits[x] = True
  15.         for k in range(10):
  16.             if digits[k] == True:
  17.                 ans = True
  18.             else:
  19.                 ans = False
  20.                 break
  21.         i += 1
  22.     print(num)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement