fork download
  1. var
  2. a, b, c, temp: Integer;
  3. begin
  4. // Пусть значения уже введены для a, b, c
  5.  
  6. if a > b then
  7. begin
  8. temp := a;
  9. a := b;
  10. b := temp;
  11. end;
  12.  
  13. if b > c then
  14. begin
  15. temp := b;
  16. b := c;
  17. c := temp;
  18. end;
  19.  
  20. // После перестановки b может снова стать больше a
  21. if a > b then
  22. begin
  23. temp := a;
  24. a := b;
  25. b := temp;
  26. end;
  27.  
  28. // Теперь числа a, b, c расположены по возрастанию
  29. WriteLn('a=', a, ' b=', b, ' c=', c);
  30. end.
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
a=0 b=0 c=0