public static void main (String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("請輸入數值");
String text=br.readLine();
String [] names=text.split("");
int names1[]=new int[names.length];
for(int i=1;i<names.length;i++)
{
names1=Integer.parseInt(names);
}
Set<Integer> intSet = new HashSet<Integer>();
for (int element : names1)
{
intSet.add(element);
}
int nonDuplicateArray[] = new int[intSet.size()];
Object[] tempArray = intSet.toArray();
for (int i = 0; i < tempArray.length; i++)
{
nonDuplicateArray = (Integer) tempArray;
}
for (int element : nonDuplicateArray)
{
System.out.print(element + ", ");
}
}
}