Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
153592 姚旭鸿 12for循环练习I C++ Compile Error 0 MS 0 KB 169 2026-05-23 13:29:39

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:14: error: expected ';' before '==' token
     for(int i==1;i<=n;n++)
              ^
Main.cc:7:14: error: expected primary-expression before '==' token
Main.cc:7:19: warning: for increment expression has no effect [-Wunused-value]
     for(int i==1;i<=n;n++)
                   ^
Main.cc:7:22: error: expected ')' before ';' token
     for(int i==1;i<=n;n++)
                      ^
Main.cc:7:26: error: expected ';' before ')' token
     for(int i==1;i<=n;n++)
                          ^