Skip to content

Instantly share code, notes, and snippets.

@CraigRodrigues
Created July 30, 2016 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CraigRodrigues/461e188fbd8a931e70f23baa27ad25b2 to your computer and use it in GitHub Desktop.
Save CraigRodrigues/461e188fbd8a931e70f23baa27ad25b2 to your computer and use it in GitHub Desktop.
CS50x Coding Contest 2016 - One Day More
#include <stdio.h>
#include <math.h>
#include "cs50.h"
int main(void)
{
int year = GetInt();
if (year > 9999 || year < 0)
return 0;
if (year % 4 == 0)
{
if (year % 100 == 0 && year % 400 != 0)
{
printf("Not Leap Year");
return 1;
}
printf("Leap Year");
return 1;
}
else
printf("Not Leap Year");
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment