favorite We need a little bit of your help to keep things running, click on this banner to learn more


published at 12/29/19, 2:48:46 pm


published at 12/29/19, 2:49:21 pm

include <bits/stdc++.h>

using namespace std; int main() { long long a,b,c,x,y,z; cin>>a>>b>>c; cin>>x>>y>>z; if(z==0){ z=60; y=y-1; } if(y==0){ y=60; x=x-1; } if(x==0){ x=24; }

cout<<x-a<<" "<<y-b<<" "<<z-c; return 0; }

published at 12/29/19, 3:10:55 pm

include <iostream>


using namespace std; int main() { long long h1,m2,s1,m1,h2,s2,u,i; cin>>h1>>m1>>s1; cin>>h2>>m2>>s2; u=((((h23600)+(m260)+s2)-((h13600)+(m160)+s1))/3600);//saat i=((((h23600)+(m260)+s2)-((h13600)+(m160)+s1))-(((((h23600)+(m260)+s2)-((h13600)+(m160)+s1))/3600)*3600))/60;//deqiqe if(m2>m1&&s2>s1){ cout<<h2-h1<<" "<<m2-m1<<" "<<s2-s1<<endl;} else cout<<(((h2*3600)+(m260)+s2)-((h13600)+(m1*60)+s1))/3600<<" "<<i<<" "<<(((h2*3600)+(m260)+s2)-((h13600)+(m160)+s1))-(u3600)-(i*60); return 0; }

published at 3/29/20, 8:14:20 pm

var h1, h2, m1, m2, s1, s2, h, m, s :longint; begin repeat; readln (h1, m1, s1); readln (h2, m2, s2); until (h1>=0) and (h1<=h2) and (h2<=23) and (m1>=0) and (m2<=69) and (s1>=0) and (s2<=69); h:=h2-h1; if m2<m1 then begin m:=60+(m2-m1); h:=h-1; end else m:=m2-m1; if s2<s1 then begin s:=60+(s2-s1); m:=m-1; end else s:=s2-s1; writeln(h,' ',m,' ',s); end.

published at 6/27/20, 4:54:38 pm

If it is hard with <cmath>, try this one>>>

include <iostream>

using namespace std;

int main() { int h,m,s,a,b,c; cin>>h>>m>>s; cin>>a>>b>>c; a=a*3600; b=b*60; h=h*3600; m=m*60; c=(a+b+c)-(h+m+s); h=c/3600; c=c-(h*3600); m=c/60; c=c-(m*60); cout<<h<<" "<<m<<" "<<c;