fork download
  1. program compFourNums;
  2. var
  3. a, b, c, d: smallint;
  4.  
  5. procedure swap(var x, y: smallint);
  6. var temp:smallint;
  7. begin
  8. temp := x;
  9. x := y;
  10. y := temp;
  11. end;
  12.  
  13. begin
  14. readln(a, b, c, d);
  15. if c<d then swap(c, d);
  16. if b<c then swap(b, c);
  17. if a<b then swap(a, b);
  18. if c<d then swap(c, d);
  19. if b<c then swap(b, c);
  20. if c<d then swap(c, d);
  21. writeln(a, ' ', b, ' ', c, ' ', d);
  22. end.
Success #stdin #stdout 0s 5276KB
stdin
1 1 2 0
stdout
2 1 1 0