Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110111 | 彭士宝 | 拉线开关 | C++ | Accepted | 1 MS | 264 KB | 311 | 2025-02-14 18:04:43 |
#include <iostream> using namespace std; int main() { int M; cin >> M; // 输入拉动开关的次数 // 判断奇偶性 if (M % 2 == 1) { cout << 1 << endl; // 奇数次,灯点亮 } else { cout << 0 << endl; // 偶数次,灯熄灭 } return 0; }