作者:longfeiPHP | 来源:互联网 | 2023-05-17 17:50
Thisblockofcodeissupposedtosortthenumbersinascendingorderbutitoutputsvertically,how
This block of code is supposed to sort the numbers in ascending order but it outputs vertically, how can I output them horizontally?
这段代码应该按升序对数字进行排序,但是它会垂直输出,如何水平输出?
Example Output:
示例输出:
1st array: 1 2 3
2nd array: 3 4 5
3rd array: 3 4 6
int[] i1 = new int[]{3, 2, 1};
Arrays.sort(i1);
System.out.print("1st array : ");
for(int index=0; index
3 个解决方案