Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
149530 王峻熙 13求n的阶乘 C++ Accepted 0 MS 268 KB 324 2026-03-14 09:29:17

Tests(10/10):


Code:

#include <iostream> int main() { int n; std::cin >> n; if (n < 0) { std::cout << "负数没有阶乘" << std::endl; return 1; } unsigned long long result = 1; for (int i = 1; i <= n; ++i) { result *= i; } std::cout << result << std::endl; return 0; }