Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int months[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
- int main()
- {
- int count=0, d=0, m;
- for (m=0; m<12*100; m++)
- {
- d += months[m%12];
- if (m%12 == 1 && (m/12)%400 == 0 && (m/12)%100 != 0 && (m/12)%4 == 0) d++;
- if (d%7 == 0) count++;
- }
- printf("%d\n",count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement