Created
October 22, 2021 12:05
-
-
Save KotaroS/d2012b0164b12b76240fceecbb89ddcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cyc(a, b, lim): | |
c = a + b | |
if c > lim: | |
return b | |
return cyc(b, c, lim) | |
limin = input() | |
lim = 0 | |
try: | |
lim = int(limin) | |
except ValueError as e: | |
print('整数を入力してください') | |
exit() | |
x = cyc(1, 1, lim) | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment