Var a,b,c,d:integer; begin writeln('a, b, c:'); readln(a,b,c); if (a>b)and(a<c)or(a>c)and(a<b) then begin d:=b; b:=c; c:=d; end else if (b>a)and(b<c)or(b>c)and(b<a) then begin d:=a; a:=c; c:=d; end else begin d:=a; a:=b; b:=d; end; writeln('a = ',a,' b = ',b,' c = ',c); end.
Var a,b,c:integer; max,min:integer; begin readln(a,b,c); if ((a>=b)and(a>=c)and(b<=c))or((b>=a)and(b>=c)and(a<=c)) then swap(a,b) else if ((a>=b)and(a>=c)and(c<=b))or((c>=b)and(c>=a)and(a<=b)) then swap(a,c) else if ((b>=a)and(b>=c)and(c<=a))or((c>=b)and(c>=a)and(b<=a)) then swap(b,c); writeln(a,' ',b,' ',c); end.
begin
writeln('a, b, c:');
readln(a,b,c);
if (a>b)and(a<c)or(a>c)and(a<b)
then begin d:=b; b:=c; c:=d; end
else if (b>a)and(b<c)or(b>c)and(b<a)
then begin d:=a; a:=c; c:=d; end
else begin d:=a; a:=b; b:=d; end;
writeln('a = ',a,' b = ',b,' c = ',c);
end.
Пример:
a, b, c:
8 5 2
a = 2 b = 5 c = 8
a,b,c:integer;
max,min:integer;
begin
readln(a,b,c);
if ((a>=b)and(a>=c)and(b<=c))or((b>=a)and(b>=c)and(a<=c)) then swap(a,b)
else
if ((a>=b)and(a>=c)and(c<=b))or((c>=b)and(c>=a)and(a<=b)) then swap(a,c)
else
if ((b>=a)and(b>=c)and(c<=a))or((c>=b)and(c>=a)and(b<=a)) then swap(b,c); writeln(a,' ',b,' ',c);
end.