Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- bool check(int n){
- return n % 4 == 0 && n % 100 != 0 || n % 400 == 0;
- }
- void fun(int s, int e){
- int sum = 0;
- for (int i = s; i < e; i++)
- if (check(i)) sum ++;
- printf("%d", sum);
- }
- int main()
- {
- int start_year = 2000, end_year = 2400;
- fun(start_year, end_year);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement