Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100690 | 谭思宸 | 13求n加到m的和 | C++ | Compile Error | 0 MS | 0 KB | 162 | 2024-12-10 20:43:14 |
#include<iostream> using namespace std; int main() { int n,sum=0,n,m; cin>>n>>m; for(i=n;i<=m;i++) sum+=i; cout<<sum; return 0; }
Main.cc: In function 'int main()': Main.cc:5:16: error: redeclaration of 'int n' int n,sum=0,n,m; ^ Main.cc:5:8: note: 'int n' previously declared here int n,sum=0,n,m; ^ Main.cc:7:8: error: 'i' was not declared in this scope for(i=n;i<=m;i++) ^