完成功能

PerDign 2011-07-07 02:20:39
1 从键盘读入10个整数放入数组
2 从数组中找出最大数
3 排序

public class NumArray
{
int ints[]_____?____;
byte bytebuffer[]=new byte[20];
for(int i=0; i<9; i++)
{
try {
System.in.read(bytebuffer);
String s =new String(bytebuffer);
ints[i]=lnteger.parselnt(s.trim());//trim()去空格
catch(Exception e){}
}
int temp =ints[0];
for (int i=1 ; i<=9; i++)
{
if_(__??__)_
temp=ints[i];
}
System.out.println(" The maxnumber is:"+temp);
for(int i=0; i<=8; i++)
for(int j=i+1; j<=9;j++)
{
if (int[i]<int[j])
}
_____??______;
_____??________;
ints[i]= temp;

}
}
System.out.println("the sorted intarray is");
for(int i=0; i<9; i++)
System.out.print(ints[i]+"");
}
}
????帮忙填写下
...全文
152 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zn85600301 2011-07-07
  • 打赏
  • 举报
回复
作业是要自己写的 问题都不难 多想会就想出来了
huanhuan527 2011-07-07
  • 打赏
  • 举报
回复
1.{10} 2.int[i]>int[i-1] 3.temp=ints[j] ints[j]=ints[i]


不知道对不

51,409

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧