Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- bool is_visocos(int year) {
- if(year % 4 != 0) return 0;
- if(year % 100 != 0) return 0;
- if(year % 400 == 0) return 1;
- }
- vector <int> day = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- int main()
- {
- int a, b, c;
- cin >> a >> b >> c;
- if(is_visocos(c))
- {
- day[1] = 29;
- }
- int cntok = 0;
- if (1 <= b && b <= 12)
- {
- if(1 <= a && a <= day[b])
- {
- cntok++;
- }
- }
- swap(a, b);
- if(1 <= b && b <=12){
- if(1 <=a && a <=day[b])
- cntok++;
- }
- if(cntok == 2) cout << 0;
- else cout << 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement