将一维数组中的元素倒序输出的代码为:
package lianxi;
public class daoxu {
public static void main(String[] args) {
int [] a={3,4,5,6,7,8,9};
int i,b;
System.out.print(“数组的原顺序为:”);
for(i=0;i<7;i++) {
System.out.print(a[i]+" “);
}
System.out.println();
System.out.print(“数组的倒序为:”);
for(i=6;i>=0;i–) {
System.out.print(a[i]+” ");
}
}
}
代码运行如图所示: