子界类型有关问题,求高手帮助

子界类型问题,求高手帮助。
1.利用子界类型编写程序,输入2000年至2099年中的任意一年及其月份,判断输入的
月份有多少天。 两个Edit。text,一个Button按钮,两个Label组件。


------解决方案--------------------
考题吗?
如果仅要功能,用这个即可
Returns the number of days in a specified month of a specified year.

Unit

DateUtils

Category

datetime routines

Delphi syntax:

function DaysInAMonth(const AYear, AMonth: Word): Word;
------解决方案--------------------
年:Edit1
月:Edit2

uses DateUtils;

procedure TFrom1.Button1click(sender:tobject);
var
 days:Word;
begin
days:=DaysInAMonth(StrToInt(Edit1.Text),StrToInt(Edit2.Text));
showmessage(Edit1.Text+'年'+Edit2.Text+'月有'+IntToStr(days)+'天');
end;