begin write('Enter the year: '); readln(year); write('Enter the month (1-12): '); readln(month);
case month of 1, 3, 5, 7, 8, 10, 12: begin writeln('There are 31 days in this month.'); end; 4, 6, 9, 11: begin writeln('There are 30 days in this month.'); end; 2: begin if ((year mod 4 = 0) and (year mod 100 <> 0)) or (year mod 400 = 0) then writeln('There are 29 days in this month.') else writeln('There are 28 days in this month.'); end; else begin writeln('Invalid month number.'); end; end;
program DaysInMonth;
var
year, month: integer;
begin
case month ofwrite('Enter the year: ');
readln(year);
write('Enter the month (1-12): ');
readln(month);
1, 3, 5, 7, 8, 10, 12:
begin
writeln('There are 31 days in this month.');
end;
4, 6, 9, 11:
begin
writeln('There are 30 days in this month.');
end;
2:
begin
if ((year mod 4 = 0) and (year mod 100 <> 0)) or (year mod 400 = 0) then
writeln('There are 29 days in this month.')
else
writeln('There are 28 days in this month.');
end;
else
begin
writeln('Invalid month number.');
end;
end;
end.