Advertisement
Glenpl

dni w miesiacu

Jan 31st, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. const int daysinmonths[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  2. int daysInMonth(int year, int month)
  3. {
  4.  if(month == 2 && ((year%4==0 && year%100!=0) || year%400==0))
  5.    return 29;
  6.  return daysinmonths[month-1];
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement