0
Can u pls help me about java?
It seems like; the input must input: 2 1 4 3 5 Output: 1,2,3,4,5
3 Answers
+ 4
I assume that the task is to sort input numbers?
Please give the complete task description and link your code attempt.
0
Scanner sc = new Scanner(System.in);
int[] arr = new int[5];
for(int i=0; i<5; i++) arr[i] = sc.nextInt();
Arrays.sort(arr);
System.out.println(Arrays.toString(arr));
https://www.sololearn.com/compiler-playground/cQSnaY0E2FaD
0
Yes to sort input numbers