Created
October 9, 2012 07:09
-
-
Save GZShi/3857116 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> | |
#define TRUE 1 | |
#define FALSE 0 | |
int judge(int year) | |
{ | |
if(year % 4 != 0) | |
return FALSE; | |
else if(year % 100 == 0) | |
{ | |
if(year % 400 == 0) | |
return TRUE; | |
else | |
return FALSE; | |
} | |
else | |
return TRUE; | |
} | |
int main(void) | |
{ | |
int year = 0; | |
char *s[2] = {"NO", "YES"}; | |
scanf("%d", &year); | |
printf("%s\n", s[judge(year)]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment