用户输出
How can you sleep at your age?
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#116920 | #1463. [L1-1] 你是否清醒 | Accepted | 100 | 17 ms | 500 K | C++ 11 / 598 B | szc | 2025-04-15 21:43:26 |
#include <iostream>
using namespace std;
int main() {
int x, y;
cin >> x >> y; // 读取当前时间的小时和分钟
// 将当前时间转换为总分钟数
int current = x * 60 + y;
// 定义关键时间点(分钟数)
const int sleep_time = 8 * 60; // 8:00
const int wake_time = 16 * 60; // 16:00
// 判断是否清醒
if ((current >= wake_time) || (current < sleep_time)) {
cout << "Good morning!" << endl;
} else {
cout << "How can you sleep at your age?" << endl;
}
return 0;
}
用户输出
How can you sleep at your age?
系统信息
Exited with return code 0
用户输出
How can you sleep at your age?
系统信息
Exited with return code 0
用户输出
How can you sleep at your age?
系统信息
Exited with return code 0
用户输出
How can you sleep at your age?
系统信息
Exited with return code 0