import java.util.Scanner;
import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
while (in.hasNextInt()) { // 注意 while 处理多个 case
int a = in.nextInt();
List<Integer> trr = new ArrayList<Integer>();
while(a>=10){
int weishu= a%10;
if(!trr.contains(weishu)){
trr.add(weishu);
}
a=(a-weishu)/10;
}
if(a<10 && !(trr.contains(a))){
trr.add(a);
}
String out = "";
for(Integer j:trr){
out=out+j;
}
System.out.println(Integer.parseInt(out));
}
}
}
提取不重复的整数
最新推荐文章于 2024-07-27 13:31:57 发布