Scanner sc = new Scanner(System.in); //获取这个数 int num = sc.nextInt(); //利用HashSet添加数字时返回的布尔值来判断数字是否重复 HashSet<Integer> set = new HashSet<>(); //倒叙输出,退出条件是,num循环被10整除到0 -- 代表num的位数已经遍历完毕 while (num!=0){  ...