作者在 2011-12-13 09:57:46 发布以下内容
import java.util.Scanner;
class ArrayDemo{
public static void main(String args[]){
sortArray();
}
/**
*一维数组的使用
*/
public static void sortArray() throws Exception{
Scanner in = new Scanner(System.in);
System.out.println("Input one number");
int length = in.nextInt();
int array [] = new int[length];
for(int b=0;b<array.length;b++)
array[b] =Integer.parseInt(in.next());
}
}
class ArrayDemo{
public static void main(String args[]){
sortArray();
}
/**
*一维数组的使用
*/
public static void sortArray() throws Exception{
Scanner in = new Scanner(System.in);
System.out.println("Input one number");
int length = in.nextInt();
int array [] = new int[length];
for(int b=0;b<array.length;b++)
array[b] =Integer.parseInt(in.next());
}
}