?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
ComboBox1: TComboBox;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
year,month,day:integer;
begin
year:=strtoint(edit1.Text);
month:=strtoint(combobox1.Text);
case month of
1,3,5,7,8,10,12:day:=31;
4,6,9,11:day:=30;
2:if(year mod 4=0)and(year mod 100<>0)or(year mod 400=0)
then day:=29
else day:=28;
end;
edit2.Text:=inttostr(year)+'年'+inttostr(month)+'月是'+inttostr(day)+'天';
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -