View Code of Problem 56

#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
	int a,b,c;
	int d,e,f;
	scanf("%d:%d:%d",&a,&b,&c);
	scanf("%d:%d:%d",&d,&e,&f);
	int sum=fabs(a*60*60+b*60+c-(d*60*60+e*60+f));
	printf("%d:%.2d:%.2d",sum/60/60,sum/60%60,sum%60);
	return 0;
}

Double click to view unformatted code.


Back to problem 56