const days: array [1..12] of integer = (31,28,31,30,31,30,31,31,30,31,30,31);
var m, y: integer;
begin
repeat
Write('Введите год и месяц: '); ReadLn(y,m);
until m in [1..12];
if m<>2 then WriteLn(days[m])
else WriteLn(days[m]+ord(((y mod 4=0)and(y mod 100<>0))or(y mod 400=0)));
end.
var m, y: integer;
begin
repeat
Write('Введите год и месяц: '); ReadLn(y,m);
until m in [1..12];
if m<>2 then WriteLn(days[m])
else WriteLn(days[m]+ord(((y mod 4=0)and(y mod 100<>0))or(y mod 400=0)));
end.