View Code of Problem 56

#include<stdio.h>
#include<math.h>
int main()
{
	int a,b,c,x,y,z,s;
	scanf("%d:%d:%d",&a,&b,&c);
	scanf("%d:%d:%d",&x,&y,&z);
	s=abs((a*3600+b*60+c)-(x*3600+y*60+z));
	printf("%d:%d:%d",s/3600,(s%3600)/60,(s%3600)%60);
	return 0;

}

Double click to view unformatted code.


Back to problem 56