View Code of Problem 56

#include<stdio.h>
#include<math.h>
int main()
{
	int a,b,c,d,e,f;
	scanf("%d:%d:%d",&a,&b,&c);
	scanf("%d:%d:%d",&d,&e,&f);
	int s1,s2,t;
	s1 = a*3600+b*60+c;
	s2 = d*3600+e*60+f;
	t = fabs(s1-s2);
	printf("%d:%02d:%02d",t/3600,t%3600/60,t%60);
}

Double click to view unformatted code.


Back to problem 56