Advertisement
Guest User

Michał to pizda

a guest
Nov 25th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #define BIRTH 803433600
  2. #include <stdio.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7.  
  8. time_t from1970 = time(NULL);
  9.  
  10. int seconds, days, months, years;
  11. int timeleft; //the time that "escaped" using integer
  12. int birthday;
  13.  
  14. seconds=difftime(from1970, BIRTH);
  15. days=seconds/86400;
  16. years=days/365;
  17. months=years*12;
  18. timeleft=days%365;
  19. months=months+(timeleft/30);
  20. birthday = 365 - timeleft;
  21.  
  22.  
  23. months=months%12;
  24. days=days%30;
  25.  
  26.  
  27. printf("It passed %d years %d months %d days since your birth\n",years,months,days);
  28. printf("Its %d days to your birthday", birthday); // blad to okolo 10 dni wiec jest OK
  29.  
  30.  
  31. return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement