View Code of Problem 56

#include <stdio.h>
#include <math.h>
int main(){
	
  int h1,m1,s1,h2,m2,s2,H,M,S;
  scanf("%d:%d:%d",&h1,&m1,&s1);
  scanf("%d:%d:%d",&h2,&m2,&s2);
  H=abs(h1-h2);
  M=abs(m1-m2);
  S=abs(s1-s2);
  printf("%d:%2d:%2d",H,M,S);
  

return 0;
}

Double click to view unformatted code.


Back to problem 56