Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148784 杨润东 13求n的阶乘 C++ Accepted 0 MS 268 KB 330 2026-02-28 19:40:40

Tests(10/10):


Code:

#include <iostream> using namespace std; int main() { int n; cin >> n; if (n < 0) { cout << "输入错误:阶乘不能为负数" << endl; return 1; } long long result = 1; for (int i = 1; i <= n; i++) { result *= i; } cout << result << endl; return 0; }