Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123364 赵梓渊 累加器 C++ Compile Error 0 MS 0 KB 197 2025-06-29 13:16:26

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:24: error: 'n' was not declared in this scope
   for (int i = 1; i <= n; i++) {
                        ^
Main.cc:4:7: warning: unused variable 'i' [-Wunused-variable]
   int i = 100 ;
       ^