Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- int isLeapYear(int year)
- {
- if ((year%4==0 && year%100!=0)||year%400==0)
- return 1;
- else
- return 0;
- }
- int main()
- {
- int year = 2008;
- int days = 366;
- while (days > 365)
- {
- if (isLeapYear(year))
- {
- printf("a\n");
- if (days > 366)
- {
- days -= 366;
- year += 1;
- }
- else
- break;
- }
- else
- {
- days -= 365;
- year += 1;
- }
- }
- printf("stop\n");
- }
Add Comment
Please, Sign In to add comment