| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 83932 | 刘泽熙 | 阶乘的和 | C++ | Compile Error | 0 MS | 0 KB | 224 | 2024-07-15 10:03:07 |
#include<bits/stdc++.h> using namespace std; int a(int b){ int s=1; for(int i=1;i<=a;i++){ s+s*i; } return s; } int main(){ int n,sum=0; cin>>n; for(int i=1;i<=n;i++){ sum+=a(i); } cout<<sum; }
Main.cc: In function 'int a(int)':
Main.cc:5:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
for(int i=1;i<=a;i++){
^
Main.cc:6:4: warning: statement has no effect [-Wunused-value]
s+s*i;
^