| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 150704 | zyh | 13分苹果 | C++ | Compile Error | 0 MS | 0 KB | 245 | 2026-03-30 16:45:47 |
#include <iostream> using namespace std; int main(){ int sum=0; for(int n>=1;n<1000;n++){ sum=sum+n; } cout<<sum; // cout<<1+2+3+4+.....+n; // sum(0)+1 // sum=sum+2 // sum=sum+3 // sum=sum+4 // sum=sum+5 // sum=sum+n }
Main.cc: In function 'int main()':
Main.cc:5:11: error: expected ';' before '>=' token
for(int n>=1;n<1000;n++){
^
Main.cc:5:11: error: expected primary-expression before '>=' token
Main.cc:5:16: warning: for increment expression has no effect [-Wunused-value]
for(int n>=1;n<1000;n++){
^
Main.cc:5:21: error: expected ')' before ';' token
for(int n>=1;n<1000;n++){
^
Main.cc:5:22: error: 'n' was not declared in this scope
for(int n>=1;n<1000;n++){
^