1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 6-7 ÇǺ¸³ªÄ¡ ÇÔ¼ö °è»êÇϱâ, 164ÂÊ # def fibonacci(n): if n < 0: # ÀÔ·Â ¿À·ù °Ë»ç print("À߸øµÈ ÀÔ·ÂÀÔ´Ï´Ù.") elif n == 1: # Àç±ÍÈ£Ãâ Áß´Ü Á¶°Ç return 0 elif n == 2: # Àç±ÍÈ£Ãâ Áß´Ü Á¶°Ç return 1 else: return fibonacci(n - 1) + fibonacci(n - 2) # Àç±ÍÈ£Ãâ i = int(input("¸î ¹ø° Ç×: ")) print(fibonacci(i)) | cs |