定义一个int型一维数组,包含10个元素,分别赋值1~10,然后将数组中的元素都向前移一个位置

2025-03-12 02:05:03
推荐回答(1个)
回答1:

int temp=a[0];
for(int j=0;j{
a[j]=a[j+1];
}
a[a.length-1]=temp;