Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92890 罗迎甲 15加到第几项 C++ Compile Error 0 MS 0 KB 299 2024-10-06 17:47:19

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int s=0,n=1; while(s<=1000){ #include<bits/stdc++.h> using namespace std; int main() { int s=0,n=0; while(s<=1000){ n++; s+=n; } cout<<n; return 0; } n++; } cout<<n; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:1: error: a function-definition is not allowed here before '{' token
 {
 ^
Main.cc:30:1: error: expected '}' at end of input
 }
 ^
Main.cc:5:10: warning: unused variable 'n' [-Wunused-variable]
  int s=0,n=1;
          ^
Main.cc:30:1: error: expected '}' at end of input
 }
 ^