Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool fechavalida( int d, int m, int y)
- {
- if(d < 1 or d > 31 or m < 1 or m > 12 or y < 1)
- {
- return false;
- }
- switch(m)
- {
- case 4:
- case 6:
- case 9:
- case 11: if(d > 30)
- {
- return false;
- }
- break;
- case 2: if(bisiesto(y))
- {
- if(d > 29)
- {
- return false;
- }
- }
- else if(d > 28)
- {
- return false;
- }
- break;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement