Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
330954 | 路明泽 | 【C1-5】修理钟表 | C++ | 通过 | 100 | 6 MS | 188 KB | 757 | 2025-07-11 13:04:56 |
#include <stdio.h> int main() { long long h1, m1, s1; long long h2, m2, s2; // 读取初始时间和修理耗时 scanf("%lld %lld %lld", &h1, &m1, &s1); scanf("%lld %lld %lld", &h2, &m2, &s2); // 计算总秒数 long long total_seconds = h1 * 3600 + m1 * 60 + s1; long long repair_seconds = h2 * 3600 + m2 * 60 + s2; long long new_total = total_seconds + repair_seconds; // 转换为正确的时间格式 long long new_h = (new_total / 3600) % 24; long long remaining = new_total % 3600; long long new_m = remaining / 60; long long new_s = remaining % 60; // 输出结果 printf("%lld %lld %lld\n", new_h, new_m, new_s); return 0; }