0
int [] x = {1,2,3,4,5,6,7,8,9,10};
for (int a : x){
System.out.print(a+" ");
}
int [] y = new int[10];
// reversing this array using loops
我被困在此代码如何反转这个整数数组?
int [] x = {1,2,3,4,5,6,7,8,9,10};
for (int a : x){
System.out.print(a+" ");
}
int [] y = new int[10];
// reversing this array using loops
我被困在此代码如何反转这个整数数组?
int [] x = {1,2,3,4,5,6,7,8,9,10};
for (int i = 0; i < x.length/2; i++)
{
int temp = x[i];
input[i] = x[x.length - 1 - i];
x[x.length - 1 - i] = temp;
}
你真正尝试任何事情 - 谷歌甚至?我不是粗鲁,但这显然是一个家庭作业问题,我们不在这里为你做 – LordWilmore
@SeanLeBlanc好的。 – beaker