java数组排序

来源:百度知道 编辑:UC知道 时间:2024/05/29 09:38:49
有n个整数,使其前面各数顺序 向后移m个 位置,最后m个数变成最前面的m个数!

/**
* @(#)PostPoneClass.java
*
*
* @author
* @version 1.00 2008/6/13
*/

public class PostPoneClass {
public static int ARRAYLENGTH = 10;
public static int POSTPONENUM = 3;
/**
* Creates a new instance of <code>PostPoneClass</code>.
*/
public PostPoneClass() {
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int iArr[] = new int[ARRAYLENGTH];
for(int i = 0; i < ARRAYLENGTH; i ++)
{
iArr[i] = i + 1;
}
System.out.println("Before Postpone the array:");
for(int i = 0; i < ARRAYLENGTH; i ++){
System.out.println("iArr[" + i + "] = " + iArr[i]);
}
for(int i = 0;