在我写的基础上帮我补上排序。谢谢。

[复制链接]
查看11 | 回复1 | 2011-4-16 14:28:52 | 显示全部楼层 |阅读模式
public class sin
{
public static void main(String args[])
{
int i,j,n;
int zs[];
zs=new int[10];
for(n=0;n<10;n++)
{
zs[n]=(int)(Math.random()*100+1);
System.out.println(zs[n]);
}
}
}

回复

使用道具 举报

千问 | 2011-4-16 14:28:52 | 显示全部楼层
public class sin{ public static void main(String args[]) {int i,j,n;int zs[];zs=new int[10];for(n=0;n<10;n++){ zs[n]=(int)(Math.random()*100+1); System.out.println(zs[n]);} Arrays.sort(zs);//快速排列,低到高for(int is=0;is<zs.length;is++){System.out.println(zs[is]);} }}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行