Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
75543 sh25_shenpy 求和 C++ 通过 0 MS 240 KB 235 2025-12-07 17:28:39

Tests(1/1):


#include <bits/stdc++.h> using namespace std; int m(int n) { if(n==1) return 1; else return m(n-1)+n; } int main() { int n,sum=0; cin>>n; for(int i=1;i<=n;++i) { sum+=m(i); } cout<<sum; return 0; }


测评信息: