From a797f50ca1e64f28c327055ac5aab6d2877600b5 Mon Sep 17 00:00:00 2001 From: taeeeo Date: Sun, 8 Sep 2024 02:00:04 +0900 Subject: [PATCH] Add files via upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 10872,팩토리얼 재귀함수이용 --- gg.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 gg.py diff --git a/gg.py b/gg.py new file mode 100644 index 0000000..f3eb13a --- /dev/null +++ b/gg.py @@ -0,0 +1,11 @@ + +n=int(input()) + +def f(n): + if n==1: + return 1 + + return n * f(n-1) + +print(f(n)) +