两种方法(Java): 法1:HashMap和TreeSet(不推荐) import java.util.*; public class Main{ public static void main(String[] args) { scanStr(); } &nb...