Skip to content

Instantly share code, notes, and snippets.

@Wigny
Created May 16, 2020 01:06
Show Gist options
  • Save Wigny/8263f6daca43f5a2d6edef3e804173bb to your computer and use it in GitHub Desktop.
Save Wigny/8263f6daca43f5a2d6edef3e804173bb to your computer and use it in GitHub Desktop.
void main() {
var n = <int>[54, 1, 30, 4, 0];
for (var i = 0; i < n.length; i++) {
for (var j = 0; j < n.length - 1; j++) {
var maior = 0;
if (n[j] > n[j + 1]) {
maior = n[j];
n[j] = n[j + 1];
n[j + 1] = maior;
}
}
}
print(n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment