From 35ed69f23a0ca950c0bd27ab0ccd540644177e9b Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 9 May 2022 19:18:32 +0800 Subject: [PATCH] =?UTF-8?q?819.=20=E9=80=92=E5=BD=92=E6=B1=82=E9=98=B6?= =?UTF-8?q?=E4=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/14063914/ --- AcWing/819/819.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 AcWing/819/819.cpp diff --git a/AcWing/819/819.cpp b/AcWing/819/819.cpp new file mode 100644 index 00000000..ea7655c6 --- /dev/null +++ b/AcWing/819/819.cpp @@ -0,0 +1,20 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int f(int x) { + return x == 1 ? 1 : x * f(x - 1); +} + +int n; + +int main() { + std::ios::sync_with_stdio(false); + + cin >> n; + cout << f(n) << endl; + + return 0; +}