Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. bool is_visocos(int year) {
  8. if(year % 4 != 0) return 0;
  9. if(year % 100 != 0) return 0;
  10. if(year % 400 == 0) return 1;
  11. }
  12. vector <int> day = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  13. int main()
  14. {
  15. int a, b, c;
  16. cin >> a >> b >> c;
  17. if(is_visocos(c))
  18. {
  19. day[1] = 29;
  20. }
  21. int cntok = 0;
  22. if (1 <= b && b <= 12)
  23. {
  24. if(1 <= a && a <= day[b])
  25. {
  26. cntok++;
  27. }
  28. }
  29. swap(a, b);
  30. if(1 <= b && b <=12){
  31. if(1 <=a && a <=day[b])
  32. cntok++;
  33. }
  34. if(cntok == 2) cout << 0;
  35. else cout << 1;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement