Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147164 王晏林 一起找规律 C++ Compile Error 0 MS 0 KB 157 2026-02-03 11:53:29

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int n=1,k+1; for(int i=2;i<=30;i++){ n*=2; k+=n; } cout<<k<<" "; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:4:14: error: expected initializer before '+' token
     int n=1,k+1;
              ^
Main.cc:7:3: error: 'k' was not declared in this scope
   k+=n;
   ^
Main.cc:9:8: error: 'k' was not declared in this scope
  cout<