题目描述
思路分析
set去重
代码实现
package lanqiao;import java.util.*;
public class Main {public static Set<String> set=new TreeSet<>();public static void main(String[] args) {Scanner scanner = new Scanner(System.in);while (scanner.hasNextLine()){set.clear();String s = scanner.nextLine();for (int i = 0; i < s.length(); i++)set.add(s.substring(i));for(String set1:set){System.out.println(set1);}}}
}