Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ILE_LICZB = int(input("Wpisz ile ma byc wpisanych liczb: "))
- if ILE_LICZB < 0:
- print("BLAD")
- memory = {0: 0, 1: 1, 2: 2}
- def tribo(n):
- if not n in memory:
- memory[n] = tribo(n - 1) + tribo(n - 2) + tribo(n - 3)
- return memory[n]
- for _ in range(ILE_LICZB):
- n = int(input())
- if n <= 0 or n >= 1000000000000:
- print(str("BLAD"))
- elif n == tribo(n):
- print(str(n) + '\tTAK')
- else:
- print(str(n) + '\tNIE')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement