update: add usage

This commit is contained in:
Ture Bentzin 2025-11-20 17:13:19 +00:00
parent ce8fd497e8
commit 056e4b4df0
No known key found for this signature in database
GPG Key ID: F1E670A1ED8E92CE

View File

@ -29,6 +29,12 @@ public class Sort {
}
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();
System.out.println("Input: " + Arrays.toString(input));
System.out.println("Output: " + Arrays.toString(selectionSort1(input)));