delphi 程序题,会的赐教

delphi 程序题,会的赐教,第1张

TPoint=object

private

fx,fy:integer

public

property x:integer read fx write fx

property y:integer read fy write fy

constructor create

end

Tline=object

private

d1,d2:TPoint

public

function LengLine(p1,p2:TPoint):integer

constructor create

end

constructor Tpoint.create

begin

fx:=0

fy:=0

end

constructor TLine.create

begin

d1.x:=0

d1.y:=0

d2.x:=0

d2.y:=0

end

function Tline.LengLine(p1,p2:TPoint):integer

begin

result:=sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y))

end

var a,b,c:string

begin

a:=Copy(edit1.text,1,1)

b:=Copy(edit1.text,2,1)

c:=Copy(edit1.text,3,1)

showmessage(a)

showmessage(b)

showmessage(c)

end

2:

var a,b,c:integer

begin

a:=strtoint(Copy(edit1.text,1,1))

b:=strtoint(Copy(edit1.text,2,1))

c:=strtoint(Copy(edit1.text,3,1))

showmessage(inttostr(a))

showmessage(inttostr(b))

showmessage(inttostr(c))

end


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/yw/12426259.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存