Created
November 19, 2016 22:31
-
-
Save 0x416E64/34cb608120af6470cc8f3e3852f899f5 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 <stdio.h> | |
int numOfDays(int m, int y) | |
{ | |
return 0; | |
} | |
int isLeapYear(int y) | |
{ | |
return 0; | |
} | |
int daysSinceBeginning( int y, int m, int d ) { | |
int days = d; | |
while( m > 1 ) { | |
m--; | |
days += numOfDays( m, y ); | |
} | |
while( y > 2000 ) { | |
y--; | |
printf( "y%d\n", y); | |
if( isLeapYear( y ) ) days += 366; | |
else days += 365; | |
} | |
printf( "%d\n", days ); | |
return days; | |
} | |
int main() | |
{ | |
daysSinceBeginning(2015, 1, 1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment