|
5啊哈币
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int main()
- {
- int h1,h2,m1,m2,s1,s2,h,m,s,x,y,a,b;
- cin>>h1>>m1>>s1;
- cin>>h2>>m2>>s2;
- x=h1*3600+m1*60+s1;
- y=h2*3600+m2*60+s2;
- if(x>y)
- x=x-y;
- else{
- x=y-x;
- }
- h=x/3600;
- x=x%3600;
- m=x/60;
- s=x%60;
- if(h>=24)
- {
- h=h%24;
- }
- cout<<fixed<<setprecision(2)<<h<<":"<<fixed<<setprecision(m)<<h<<":"<<fixed<<setprecision(2)s;
- return 0;
- }
复制代码 |
|