Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <time.h>
  3. #include <stdio.h>
  4.  
  5. void main()
  6. {
  7. struct timeval tvTime;
  8. struct tm tmOutput;
  9.  
  10. gettimeofday(&tvTime, 0);
  11. localtime_r(&(tvTime.tv_sec), &tmOutput);
  12.  
  13. tmOutput.tm_mon += 1;
  14. printf("password for today is: %x%02d-%02x%02d\n\n",
  15. tmOutput.tm_mon, tmOutput.tm_mon, tmOutput.tm_mday,
  16. gcd(tmOutput.tm_mon, tmOutput.tm_mday));
  17. }
  18.  
  19. int gcd(int a, int b)
  20. {
  21. return (b?gcd(b,a%b):a);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement