Guest User

Untitled

a guest
Apr 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. pole = {1, 5, 48, 54, 7, 59, 6};
  2. f[x_] :=
  3. Module[{i, j, tmp},
  4. For[i = 1, i < Length[x], i++,
  5. For[j = 1, j < Length[x], j++,
  6. If[x[[j]] > x[[j + 1]],
  7. {tmp = x[[j]];
  8. x[[j]] = x[[j + 1]];
  9. x[[j + 1]] = tmp;}
  10. ];
  11. ];
  12. ];
  13. Return[x];
  14. ]; f[pole]
Add Comment
Please, Sign In to add comment