Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
330958 | 路明泽 | 【C1-5】时间 | C++ | 通过 | 100 | 5 MS | 192 KB | 490 | 2025-07-11 13:07:31 |
#include <stdio.h> int main() { int x1, y1, x2, y2; scanf("%d", &x1); scanf("%d", &y1); scanf("%d", &x2); scanf("%d", &y2); // 计算两个时刻的总分钟数 int total_a = x1 * 60 + y1; int total_b = x2 * 60 + y2; // 计算差值(考虑跨天情况) int diff = total_b - total_a; if (diff < 0) { diff += 24 * 60; // 加上一天的分钟数 } printf("%d\n", diff); return 0; }