View Code of Problem 56

#include<stdio.h> 
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<stdlib.h>
int main(){ 
    int a,b,c,d,e,f;
    scanf("%d:%d:%d\n%d:%d:%d",&a,&b,&c,&d,&e,&f);
    int t1,t2,t;
    t1=a*3600+b*60+c;
    t2=d*3600+e*60+f;
    t=fabs(t1-t2);
    printf("%d:%02d:%02d\n",t/3600,t%3600/60,t%3600%60);
    return 0; 
     
}

Double click to view unformatted code.


Back to problem 56