提交时间:2024-08-20 12:29:11
运行 ID: 168634
#include <iostream> using namespace std; long long factorial(int n) { long long result = 1; for(int i = 2; i <= n; ++i) result *= i; return result; } int main() { int n; cin >> n; cout << n << "!=" << factorial(n) << endl; return 0; }