#include <stdio.h> #include <math.h> int main(){ int a,b,c,d,e,f; scanf("%d:%02d:%d",&a,&b,&c); scanf("%d:%02d:%d",&d,&e,&f); int x=abs(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:%d\n",a,b,c); return 0; } |
Double click to view unformatted code.