Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool isValidDate(int dan, int mjesec, int godina) {
- bool prestupna = (godina%4 == 0 && godina%100 != 0 || godina%400 == 0);
- int daniUMjesecima[12] = {31, 28 + prestupna, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
- if (mjesec < 1 || mjesec > 12 || dan < 1 || dan > daniUMjesecima[mjesec - 1])
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement