Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:明天考试啦。。。help [Re:ggloverv]
ggloverv





发贴: 5
积分: 0
于 2008-07-12 15:18 user profilesend a private message to usersend email to gglovervsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Don't you think that is too long?

import java.util.Scanner;
import java.util.TreeSet;

class Test2{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    TreeSet set = new TreeSet();
    
    for (int i=1;i<=10;i++){
      System.out.println("输入第"+i+"个数:");
      int d = scan.nextInt();
      set.add( d );
    }
    
    for(Object o:set){
      System.out.print(o.toString());
    }
  }
}



RVstudio

话题树型展开
人气 标题 作者 字数 发贴时间
11012 明天考试啦。。。help ggloverv 65 2008-07-09 22:34
8263 Re:明天考试啦。。。help weiyidexuan 936 2008-07-11 01:30
7905 Re:明天考试啦。。。help JiafanZhou 4637 2008-07-11 20:27
7880 Re:明天考试啦。。。help JiafanZhou 5697 2008-07-11 20:28
7978 Re:明天考试啦。。。help JiafanZhou 4261 2008-07-11 20:29
7996 Re:明天考试啦。。。help Miragi_Song 123 2008-07-12 02:38
8174 Re:明天考试啦。。。help JiafanZhou 383 2008-07-15 16:19
8155 Re:明天考试啦。。。help ggloverv 762 2008-07-12 15:18
8093 Re:明天考试啦。。。help wusky 0 2008-07-14 02:05

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2020 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号
客服电话 0592-8750026    客服信箱 714923@qq.com    客服QQ 714923