Реализуйте решение задачи , программируя на Паскале. По номеру месяца вывести на печать количество дней в нем . ( Январь - 1 месяц, декабрь-12 месяц .)
begin writeln('Enter the number of the month (1-12): '); readln(month);
case month of 1, 3, 5, 7, 8, 10, 12: writeln('There are 31 days in this month.'); 4, 6, 9, 11: writeln('There are 30 days in this month.'); 2: writeln('There are 28 or 29 days in this month, depending on the year.');
else writeln('Invalid month number. Please enter a number between 1 and 12.'); end; end.
program DaysInMonth;
var
month: integer;
begin
writeln('Enter the number of the month (1-12): ');
readln(month);
case month of
1, 3, 5, 7, 8, 10, 12:
writeln('There are 31 days in this month.');
4, 6, 9, 11:
writeln('There are 30 days in this month.');
2:
writeln('There are 28 or 29 days in this month, depending on the year.');
else
writeln('Invalid month number. Please enter a number between 1 and 12.');
end;
end.