uses crt;
var a,b:integer;
bo:boolean;
begin
write('Nhap nam :');readln(b);
if (b mod 100=0) then bo:=(b mod 400)=0 else
bo:=(b mod 4 )=0;
if bo then
begin
repeat
clrscr;
write('Nhap thang :');readln(a);
until (a>0) and (a<13);
case a of
2:write('Co 29 ngay');
1,3,5,7,8,10,12:write('Co 31 ngay');
4,6,9,11:write('Co 30 ngay');
end;
end;
if (not bo) then
begin
repeat
clrscr;
write('Nhap thang :');readln(a);
until (a>0) and (a<13);
case a of
2:write('Co 28 ngay');
1,3,5,7,8,10,12:write('Co 31 ngay');
4,6,9,11:write('Co 30 ngay');
end;
end;
readln;
end.