/**
* @author besty_wang:
* @version 创建时间:2016年8月1日 下午9:32:36
* 类说明 将一个数组逆序输出
*/
public class ArrayReverse {
public static void main(String[] args) {
int[] a = new int[100];
// creat an array
for (int i = 0; i < 100; i++)
a[i] = i;
// reverse the array
for (int i = a.length - 1; i >= 0; i--) {
System.out.print(a[i]);
if (i != 0)
System.out.print(" ");
}
}
}
数组逆序输出
最新推荐文章于 2021-10-31 17:32:21 发布