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

5th Oct 2022, 11:52 AM
Edmar Napay
Edmar Napay - avatar
3 odpowiedzi
+ 4
I assume that the task is to sort input numbers? Please give the complete task description and link your code attempt.
5th Oct 2022, 12:40 PM
Lisa
Lisa - avatar
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
5th Oct 2022, 2:17 PM
SoloProg
SoloProg - avatar
0
Yes to sort input numbers
6th Oct 2022, 4:19 AM
Edmar Napay
Edmar Napay - avatar