update: add usage
This commit is contained in:
parent
ce8fd497e8
commit
056e4b4df0
@ -29,6 +29,12 @@ public class Sort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
if (args.length == 0) {
|
||||||
|
System.err.println("Usage: <number>...");
|
||||||
|
System.exit(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int[] input = Arrays.stream(args).mapToInt(Integer::parseInt).toArray();
|
int[] input = Arrays.stream(args).mapToInt(Integer::parseInt).toArray();
|
||||||
System.out.println("Input: " + Arrays.toString(input));
|
System.out.println("Input: " + Arrays.toString(input));
|
||||||
System.out.println("Output: " + Arrays.toString(selectionSort1(input)));
|
System.out.println("Output: " + Arrays.toString(selectionSort1(input)));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user