Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
441402 徐嘉豪 【C6-4】求1!+2!+3!+4!+...+n! C++ 解答错误 0 1 MS 252 KB 237 2026-05-19 20:12:08

Tests(0/3):


#include<bits/stdc++.h> using namespace std; long long f(int x){ if(x==0||x==1) return 1; return x*f(x-1); } int main(){ int n,s=0; cin>>n; for(int i=1;i<=n;i++){ s+=f(i); } cout<<s<<endl; return 0; }


测评信息: