实验2-2-9 计算火车运行时间 (15 分)
#include <stdio.h>
int main()
{
int h1,h2;
scanf("%d %d",&h1,&h2);
int t1,t2;
t1 = (h1/100)*60 + h1%100;
t2 = (h2/100)*60 + h2%100;
int t = t2 - t1;
printf("%02d:%02d",t/60,t%60);
return 0;
}
2024-02-01 22:20:40
#include <stdio.h>
int main()
{
int h1,h2;
scanf("%d %d",&h1,&h2);
int t1,t2;
t1 = (h1/100)*60 + h1%100;
t2 = (h2/100)*60 + h2%100;
int t = t2 - t1;
printf("%02d:%02d",t/60,t%60);
return 0;
}
下一篇:vue 搜索引擎抓取(SEO)