Created
June 5, 2022 05:59
-
-
Save charlie-x/de1ecaf6c892dcb5a9f70ceacfccdb5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <time.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
int gcd(int a, int b); | |
void main() | |
{ | |
struct timeval tvTime; | |
struct tm tmOutput; | |
gettimeofday(&tvTime, 0); | |
localtime_r(&(tvTime.tv_sec), &tmOutput); | |
tmOutput.tm_mon += 1; | |
printf("password for today is: %x%02d-%02x%02d\n\n", | |
tmOutput.tm_mon, tmOutput.tm_mon, tmOutput.tm_mday, | |
gcd(tmOutput.tm_mon, tmOutput.tm_mday)); | |
} | |
int gcd(int a, int b) | |
{ | |
return (b?gcd(b,a%b):a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment