fork download
  1. #include <stdio.h>
  2. #include <time.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7. const char *a="12:59", *b="13:12";
  8.  
  9. struct tm x={.tm_mday=1,.tm_year=70,.tm_hour=atoi(a),.tm_min=atoi(a+3)},
  10. y={.tm_mday=1,.tm_year=70,.tm_hour=atoi(b),.tm_min=atoi(b+3)};
  11.  
  12. printf("%d", (int)difftime(mktime(&y),mktime(&x))/60);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2300KB
stdin
Standard input is empty
stdout
13