Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
150716 zlx 13分苹果 C++ Compile Error 0 MS 0 KB 185 2026-03-30 17:01:06

Tests(0/0):


Code:

#include <iostream> using namespace std; int main(){ int sum=(0) int n; cin>>n; int sum=0; for(int x=1;x<=n;x++){ sum=sum+x; cout<<sum; } cout<<sum; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:2: error: expected ',' or ';' before 'int'
  int n;
  ^
Main.cc:6:7: error: 'n' was not declared in this scope
  cin>>n;
       ^
Main.cc:7:6: error: redeclaration of 'int sum'
  int sum=0;
      ^
Main.cc:4:7: note: 'int sum' previously declared here
   int sum=(0)
       ^