题解 | #提取不重复的整数#
提取不重复的整数
http://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
char[] chars = (num+"").toCharArray();
String str ="";
for(int i = chars.length-1;i>=0;i--){
if(!str.contains(chars[i]+"")){
str += chars[i];
}
}
System.out.println(Integer.valueOf(str));
}
}
public class Main{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();
char[] chars = (num+"").toCharArray();
String str ="";
for(int i = chars.length-1;i>=0;i--){
if(!str.contains(chars[i]+"")){
str += chars[i];
}
}
System.out.println(Integer.valueOf(str));
}
}