zoukankan      html  css  js  c++  java
  • 输入 年,月,显示当月的天数

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;

    type
      TForm1 = class(TForm)
        Button1: TButton;
        Edit1: TEdit;
        Edit2: TEdit;
        Edit3: TEdit;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    function GetDays(Year,Mouth: integer): integer;
    begin
      case Mouth of
        1,3,5,7,8,10,12 : Result := 31;
        4,6,9,11 : Result :=30;
        2:begin
            if isleapYear(Year) then
            begin
              Result :=29;
            end else
            begin
              Result :=28;
            end;
          end else
        Result := 0;
      end;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      Edit3.Text := IntToStr(GetDays(StrToInt(Edit1.text),StrToInt(Edit2.text)));
    end;

    end.

  • 相关阅读:
    POJ2965(The Pilots Brothers' refrigerator)
    POJ1753(Flip Game)
    POJ3253(Fence Repair)
    山东理工大学的训练计划
    loutsScript 常用代码
    《大道至简》读后感
    2019暑第三周
    2019暑第二周
    2019暑第一周
    关于13组作品《TD tree》的使用感想
  • 原文地址:https://www.cnblogs.com/beeone/p/1800411.html
Copyright © 2011-2022 走看看