fork download
  1. #include <iostream>
  2. #include <time.h>
  3. #define sum(a,b) (a+b)
  4. #define TIME_TILL_UTC_00(hr,min) ((((23-(hr)) * 60) + ((60 - min))) * 60)
  5. #define SECONDS_IN_A_DAY 24*60*60
  6. int main(){
  7. int x = 10, y = 20;
  8. int ans = sum(x,y);
  9. std::cout<<"ans: "<<ans<<"\n";
  10. time_t t = time(NULL);
  11. struct tm* ti = gmtime(&t);
  12. int secondToUtc00 = TIME_TILL_UTC_00(ti->tm_hour, ti->tm_min);
  13. std::cout<<"hr: "<<ti->tm_hour<<", min: "<<ti->tm_min<<"\n";
  14. std::cout<<"secondToUtc00: "<<secondToUtc00;
  15. std::cout<<"\nin a day"<<SECONDS_IN_A_DAY;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
ans: 30
hr: 11, min: 6
secondToUtc00: 46440
in a day86400