assigment2

This commit is contained in:
2024-11-06 19:30:18 +03:00
parent ae65d78044
commit cb2460ee46
2 changed files with 30 additions and 7 deletions

View File

@ -22,7 +22,19 @@ public class numbers {
System.out.println("Not Positive!");
}
}
Collections.sort(ints);
//Collections.sort(ints);
for (int i = 0; i < counter - 1; i++) {
int minValue = i;
for (int j = i + 1; j < counter; j++) {
if (ints.get(j) < ints.get(minValue)) {
minValue = j;
}
}
int t = ints.get(i);
ints.set(i, ints.get(minValue));
ints.set(minValue, t);
}
if (counter == 0) {