Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. bool fechavalida( int d, int m, int y)
  2. {
  3.     if(d < 1 or d > 31 or m < 1 or m > 12 or y < 1)
  4.     {
  5.         return false;
  6.     }
  7.     switch(m)
  8.     {
  9.         case 4:
  10.         case 6:
  11.         case 9:
  12.         case 11: if(d > 30)
  13.                  {
  14.                     return false;
  15.                  }
  16.                  break;
  17.         case 2: if(bisiesto(y))
  18.                 {
  19.                     if(d > 29)
  20.                     {
  21.                        return false;
  22.                     }
  23.                 }
  24.                 else if(d > 28)
  25.                      {
  26.                         return false;
  27.                      }
  28.                 break;
  29.     }
  30.     return true;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement