| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 123340 | 袁梓豪 | 12奇数和与偶数和 | C++ | Compile Error | 0 MS | 0 KB | 193 | 2025-06-29 12:39:59 |
#include <bits/stdc++.h> using namespace std; int main() { int s2 = 0; for (int i = 1; i <= n; i++) { if (i % 2 == 1) { s2 = s2 + i; } } cout << s2 << endl; return 0; }
Main.cc: In function 'int main()':
Main.cc:5:23: error: 'n' was not declared in this scope
for (int i = 1; i <= n; i++) {
^