procedure TForm7.Button1Click(Sender: TObject);
var
a,b,c,d,e,t1,t2,temp:real;
function largest(d1,d2,d3:real):real;
var
cul:real;
begin
if d1>d2 then cul:=d1 else cul:=d2;
if d3>cul then cul:=d3;
largest:=cul
end;
begin
t1:=largest(a,b,c);
t2:=largest(d,e,t1)
end;
begin
if a<t2 then
begin
temp:=t2; t2:=a;a:=temp;
end;
end;
edit1.text:=floattostr(a);
edit2.text:=floattostr(b);
edit3.text:=floattostr(c);
edit4.text:=floattostr(d);
end.
var
a,b,c,d,e,t1,t2,temp:real;
function largest(d1,d2,d3:real):real;
var
cul:real;
begin
if d1>d2 then cul:=d1 else cul:=d2;
if d3>cul then cul:=d3;
largest:=cul
end;
begin
t1:=largest(a,b,c);
t2:=largest(d,e,t1)
end;
begin
if a<t2 then
begin
temp:=t2; t2:=a;a:=temp;
end;
end;
edit1.text:=floattostr(a);
edit2.text:=floattostr(b);
edit3.text:=floattostr(c);
edit4.text:=floattostr(d);
end.
解决方案 »
- 棋牌客户端 左侧游戏列表的选择问题 类名 SysTreeView32
- 两个月的业余时间终于没白费,小挣8000,高兴散分!
- 高分求解: dll中的窗体最小化后到任务栏并加载图标
- 哪位大哥知道 XBar-R等 质量控制方面的算法公式??????
- 在上网的时候有什么软件可以在网上直接发传真的吗
- 请问有没有专门介绍object pascal的好一点的书阿?谢谢啦!
- 紧急求助,vcl控件,我怎样写属性编辑器
- 高手请帮帮我把
- 为什么我报表时的PageFooter显示不出来?
- 用DELPHI如何列出当前系统引用的DLL,然后释放DLL
- Delphi 数据库不如Power Builder 吗?
- 报表生成器免费源代码,哪来就能用了呀!!!!~
begin
a:=10.5;b:=9.5;c:=11.5;d:=12;
temp:=max(max(max(a,b),c),d);
if b=temp then b:=a
else if c=temp then c:=a
else if d=temp then d:=a;
a:=temp;
temp:=max(max(b,c),d);
if c=temp then c:=b
else if d=temp then d:=b;
b:=temp;
temp:=max(c,d);
if temp=d then d:=c;
c:=temp;
edit1.text:=floattostr(a);//最大
edit2.text:=floattostr(b);
edit3.text:=floattostr(c);
edit4.text:=floattostr(d);//最小
end;
uses math;
a,b,c,d,tmp,max:Integer;
Numbers:array [0..3] of PInteger //指针数组
begin
//assign a,b,c,d
.....
Numbers[0]=@a;
Numbers[1]=@b;
Numbers[2]=@c;
Numbers[3]=@d; max:=0;
for i:=0 to 3 do
begin
if Numbers[i]^>Numbers[max]^ then max:=i;
end tmp:=a;
a:=Numbers[max]^;
Numbers[max]^=tmp;
end;end;