求助一个pascal 的问题

来源:百度知道 编辑:UC知道 时间:2024/07/01 06:38:26
2、编写一个程序,输入三个整数,按从大到小的顺序打印出来
var a,b,c,t:integer;

begin

write('input integer a,b,c:'); readln(a,b,c);

if a<b then begin t:=a; a:=b; b:=t end;

if a<c then begin t:=a; a:=c; c:=t end;

if b<c then begin t:=b; b:=c; c:=t end;

writeln(a, ' ',b,' ',c)

end.

我的程序有错呀
帮忙看一下
什么毛病
帮忙弄一个
可是运行起来有错误呀

var a,b,c:integer;
procedure swap(var a,b:integer);
var t:integer;
begin
t:=a;
a:=b;
b:=t;
end;

begin
readln(a,b,c);
if a<b then swap(a,b);
if b<c then swap(b,c);
if a<c then swap(a,c);
writeln(a,' ',b,' ',c);
end.
试一下过程行不行。

解题思路没有错啊。

我用PASCAL编译过了,程序没错.你可以把程序保存一下再试,还不行就是你PASCAL的问题了.