Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a,l,z;
- int main()
- {
- cin>>z>>l>>a;
- if((a%4==0 && a%100!=0) || (a%400==0))
- if(l>=1 && l<=12)
- if(l==1 || l==3 || l==5 || l==7 || l==8 || l==10 || l==12)
- if(z>=1 && z<=31)
- cout<<"DA";
- else
- cout<<"NU";
- else
- if(l==2)
- if(z>=1 && z<=29)
- cout<<"DA";
- else
- cout<<"NU";
- else
- if(z>=1 && z<=30)
- cout<<"DA";
- else
- cout<<"NU";
- else
- cout<<"NU";
- else
- if(l>=1 && l<=12)
- if(l==1 || l==3 || l==5 || l==7 || l==8 || l==10 || l==12)
- if(z>=1 && z<=31)
- cout<<"DA";
- else
- cout<<"NU";
- else
- if(l==2)
- if(z>=1 && z<=28)
- cout<<"DA";
- else
- cout<<"NU";
- else
- if(z>=1 && z<=30)
- cout<<"DA";
- else
- cout<<"NU";
- else
- cout<<"NU";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement