Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121071 范爱民 [在线测评解答教程] 求和 C++ Compile Error 0 MS 0 KB 180 2025-06-06 18:52:02

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:4: error: expected ';' before 'int'
    int n;
    ^
Main.cc:5:9: warning: statement has no effect [-Wunused-value]
    int n;
         ^
Main.cc:6:9: error: 'n' was not declared in this scope
    cin>>n;
         ^