View Code of Problem 56

#include <stdio.h>
#include<math.h>
int main(int argc, char *argv[])
{
		int a,b,c,d,e,f;
	scanf("%d:%02d:%02d",&a,&b,&c);
	scanf("%d:%02d:%02d",&d,&e,&f);
	int x=fabs(a*3600+b*60+c-(d*3600+e*60+f));
	a=x/3600;//h
	b=x%3600/60;//m
	c=x%3600%60;
	printf("%d:%02d:%02d\n",a,b,c);
	return 0;
}

Double click to view unformatted code.


Back to problem 56