#include<bits/stdc++.h>
using namespace std;
int main()
{int h1,h,m1,m,s1,s,qq;
cin>>h>>m>>s>>h1>>m1>>s1;
s+=m*60+h*3600;
s1+=m1*60+h1*3600;
qq=s1-s;
cout<<qq/3600;
qq-=3600*qq/3600<<":";
cout<<qq/60;
qq-=60*qq/60<<":";
cout<<qq;
return 0;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include<bits/stdc++.h>
using namespace std;
int main()
{int h1,h,m1,m,s1,s,qq;
cin>>h>>m>>s>>h1>>m1>>s1;
s+=m*60+h*3600;
s1+=m1*60+h1*3600;
qq=s1-s;
cout<<qq/3600;
qq-=3600*qq/3600<<":";
cout<<qq/60;
qq-=60*qq/60<<":";
cout<<qq;
return 0;
}