View Code of Problem 56

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

Double click to view unformatted code.


Back to problem 56