Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pole = {1, 5, 48, 54, 7, 59, 6};
- f[x_] :=
- Module[{i, j, tmp},
- For[i = 1, i < Length[x], i++,
- For[j = 1, j < Length[x], j++,
- If[x[[j]] > x[[j + 1]],
- {tmp = x[[j]];
- x[[j]] = x[[j + 1]];
- x[[j + 1]] = tmp;}
- ];
- ];
- ];
- Return[x];
- ]; f[pole]
Add Comment
Please, Sign In to add comment