谁能帮我看看这段tp那里出错了
program work06;var n,y,r:integer;
begin
write('please input the year');readln(n);
write('please input the month');readln(y);
case r of
1,3,5,7,8,10,12: r:=31;
4,6,9,11: r:=30;
2:begin
if (n mod 4=0) then begin
if (n mod 100=0)then
begin
if (n mod 400=0)then
begin
r:=31;
end
else
begin
r:=30;
end;
end
else
begin
r:=31;
end;
end
else begin
r:=30;
end;
else writeln('WRONG!');
end;
writeln('there are',r,'days in this month');
readln;
end.