Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
313089 | 123456 | 【C1-5】航班时长 | C++ | 通过 | 100 | 0 MS | 244 KB | 469 | 2025-03-16 17:07:04 |
#include<iostream> using namespace std; int main(){ int h1,m1,s1,h2,m2,s2,t1,t2,t; //h1 m1 s1起飞时间 t1起飞时间是今天的第几秒 //h2 m2 s2到达时间 t2到达时间是今天的第几秒 //t = t2 - t1 时间差,就是航班飞行时长(秒) cin>>h1>>m1>>s1>>h2>>m2>>s2; //公式1 h m s->t t1=h1*3600+m1*60+s1; t2=h2*3600+m2*60+s2; t=t2-t1; //公式2 t-->h m s cout<<t/3600<<" "<<t%3600/60<<" "<<t%60; return 0; }