1。利用枚举类型编写程序,根据输入日期判断星期几?
2。利用子界类型编写程序,实现十进制数转换为二进制,八进制,十六进制数。
小弟刚学DELPHI没多久,请各位大哥大姐说详细点~`小弟先谢过各位了!!!!!!!!!!!!!!!
两个程序问题!!
1。利用枚举类型编写程序,根据输入日期判断星期几?
2。利用子界类型编写程序,实现十进制数转换为二进制,八进制,十六进制数。
小弟刚学DELPHI没多久,请各位大哥大姐说详细点~`小弟先谢过各位了!!!!!!!!!!!!!!!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls,typinfo;
type
weekday=(sunday,monday,tuesday,wednsesday,thursday,friday,saturdat);
cc=set of char;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
DateTimePicker1: TDateTimePicker;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
d:weekday;
p:pointer;
begin
d:=sunday;
p:=TypeInfo(weekday);
edit1.Text:=getenumname(p,dayofweek(datetimepicker1.Date)-1);
end;
end.
第二个问题我没看明白.