美文网首页PAT
PAT1026打卡-0924

PAT1026打卡-0924

作者: 可爱的甜甜猪 | 来源:发表于2020-09-25 08:24 被阅读0次

include <iostream>

include <cmath>

using namespace std;
int main()
{
float C1,C2;
cin>>C1>>C2;
float c=(C2-C1)/100;
int shi=c/3600;
c=c-shi3600;
if(c<3599.5)
{
if(shi>=10)
cout<<shi<<":";
else
cout<<0<<shi<<":";
int fen=c/60;
c=c-fen
60;
if(c<59.5)
{
if(fen>=10)
cout<<fen<<":";
else
cout<<0<<fen<<":";
int d=c;
if(c-d>=0.5)
d++;
if(d>=10)
cout<<d;
else
cout<<0<<d;
}
else
cout<<fen+1<<":"<<"00";
}
else
cout<<shi+1<<":"<<"00"<<":"<<"00";
return 0;
}

相关文章

网友评论

    本文标题:PAT1026打卡-0924

    本文链接:https://www.haomeiwen.com/subject/dkttuktx.html