docs: 添加仓库地址到README;chore: 整理实验分析;feat: Kruskal最小生成树与图存储结构
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int N;
|
||||
scanf("%d", &N);
|
||||
|
||||
while (N--)
|
||||
{
|
||||
int AH, AM, AS, BH, BM, BS;
|
||||
scanf("%d %d %d %d %d %d", &AH, &AM, &AS, &BH, &BM, &BS);
|
||||
|
||||
// 直接相加
|
||||
int total_hours = AH + BH;
|
||||
int total_minutes = AM + BM;
|
||||
int total_seconds = AS + BS;
|
||||
|
||||
// 处理秒的进位
|
||||
if (total_seconds >= 60)
|
||||
{
|
||||
total_minutes += total_seconds / 60;
|
||||
total_seconds = total_seconds % 60;
|
||||
}
|
||||
|
||||
// 处理分钟的进位
|
||||
if (total_minutes >= 60)
|
||||
{
|
||||
total_hours += total_minutes / 60;
|
||||
total_minutes = total_minutes % 60;
|
||||
}
|
||||
|
||||
printf("%d %d %d\n", total_hours, total_minutes, total_seconds);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user