lazarus 入门题

来源:百度知道 编辑:UC知道 时间:2024/05/24 23:49:07
输入a,b,c,输出的是从小到大排。
怎么编?(要解释)

var a,b,c,t:integer(real); {定义}
begin
readln (a,b,c);
if a>b then t:=a;a:=b;b:=t;{如果a>b,那么交换a,b}
if a>c then t:=a;a:=c;c:=t;{同理}
if b>c then t:=b;b:=c;c:=t;
write (a,'<',b,'<',c);{打印}
readln;{可要可不要}
end.