From 567421d1c50e175bc177f0c11de0f611aaf6bb65 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 9 May 2022 19:09:42 +0800 Subject: [PATCH] =?UTF-8?q?804.=20n=E7=9A=84=E9=98=B6=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/14063689/ --- AcWing/804/804.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 AcWing/804/804.cpp diff --git a/AcWing/804/804.cpp b/AcWing/804/804.cpp new file mode 100644 index 00000000..66a9d00f --- /dev/null +++ b/AcWing/804/804.cpp @@ -0,0 +1,19 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int n, res = 1; + +int main() { + std::ios::sync_with_stdio(false); + + cin >> n; + + while (res *= n--, n) {} + + cout << res << endl; + + return 0; +}