| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 154858 | 李懋 | 12奇数和与偶数和 | C++ | Compile Error | 0 MS | 0 KB | 398 | 2026-05-31 10:52:12 |
#include<bits/stdc++.h> using namespace std; int main() { int start = min(a, b); int end = max(a, b); long long even_sum = 0; long long odd_sum = 0; for (int i = start; i <= end; ++i) { if (i % 2 == 0) { even_sum += i; } else { odd_sum += i; } } cout << even_sum << " " << odd_sum << endl; return 0; }
Main.cc: In function 'int main()':
Main.cc:5:21: error: 'a' was not declared in this scope
int start = min(a, b);
^
Main.cc:5:24: error: 'b' was not declared in this scope
int start = min(a, b);
^