Skip to content

Instantly share code, notes, and snippets.

@KotaroS
Created October 22, 2021 12:05
Show Gist options
  • Save KotaroS/d2012b0164b12b76240fceecbb89ddcc to your computer and use it in GitHub Desktop.
Save KotaroS/d2012b0164b12b76240fceecbb89ddcc to your computer and use it in GitHub Desktop.
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