uva-10815 - Andy's First Dictionary
来源:互联网 发布:sql where执行顺序 编辑:程序博客网 时间:2024/06/06 02:29
题意:给你数个字符串,要你把字符串中的所以出现单词,不重复的按字典序输出。
思路:切割字符串,然后使用set存储单词
package test;import java.util.Scanner;import java.util.TreeSet;public class Test{static TreeSet<String> tree = new TreeSet<String>();public static void main(String[] args) {Scanner sc = new Scanner(System.in);String line = null;while(!"".equals((line=sc.nextLine().toLowerCase()))){for(String s : line.split(" ")){tree.add(s);}}System.out.println(tree);sc.close();}}
0 0
- UVa OJ 10815-Andy's First Dictionary
- uva 10815 Andy's First Dictionary
- UVa 10815 - Andy's First Dictionary
- UVA 10815 - Andy's First Dictionary
- uva-10815 - Andy's First Dictionary
- UVa 10815 - Andy's First Dictionary
- UVA 10815 Andy's First Dictionary
- UVa 10815 - Andy's First Dictionary
- UVA 10815 Andy's First Dictionary
- UVa-10815 - Andy's First Dictionary
- UVA 10815 - Andy's First Dictionary
- uva -- 10815 Andy's First Dictionary
- UVA 10815 Andy's First Dictionary
- uva 10815 Andy's First Dictionary
- UVa 10815 - Andy's First Dictionary
- uva - 10815 - Andy's First Dictionary
- UVA 10815 Andy's First Dictionary
- Uva 10815 - Andy's First Dictionary
- TabHost+RadioGroup实现底部导航栏
- PHP 如何获取当前的域名
- uva10562 Undraw the Trees
- 【转载】sip协议介绍
- 翻译经典之《Cisco Lan Switching》第六章 理解生成树(三):生成树协议的两个关键概念
- uva-10815 - Andy's First Dictionary
- 文章标题
- java常用API
- iOS开发-autolayout动画效果实现的几种方法
- printf 函数问题
- Android签名与认证详细分析之一
- windows 内存泄漏检测工具vld相关
- windows上搭建mysql的主从复制测试环境
- 组合数取模