import java.lang.*;
import java.util.*;
import java.util.Scanner;
public class JVD01
{
public static void main(String[] args)
{
int num;
int i,j;
Scanner in = new Scanner(System.in);
Random rnd = new Random((new Date()).getTime());
while(true)
{
System.out.print("please imput: ");
num = in.nextInt();
int[] sort = new int[num];
for(i=0;i<num;i++)
{
sort[i]=rnd.nextInt(1000);
}
for(i=0;i<num;i++)
{
for(j=i+1;j<num;j++)
{
if(sort[i]>sort[j])
{
int tt = sort[i];
sort[i] = sort[j];
sort[j] = tt;
}
}
}
for(i=0;i<num;i++)
{
System.out.println(sort[i]);
}
}
}
} |