Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113871 | 罗子童 | 阶乘的和 | C++ | Compile Error | 0 MS | 0 KB | 438 | 2025-03-16 19:18:51 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int jc(int a){ int s=1; for(int i=1;i<=a;i++){ s*=i; } int main(){ int n,sum=0; cin>>n; for(int i=1;i<=n;i++){ sum+=jc(i); } return 0; }
Main.cc: In function 'int jc(int)': Main.cc:12:11: error: a function-definition is not allowed here before '{' token int main(){ ^ Main.cc:19:1: error: expected '}' at end of input } ^ Main.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]