public static void main(String[] args){
Scanner cin=new Scanner(System.in);int hash[]=new int[256];if (cin.hasNext()){String temp=cin.next();func(temp, hash);}
}
public static void func(String str, int[] hash){
for (int i = 0; i < str.length(); i++){
char c=str.charAt(i);if (hash[c]==0){hash[c]=1;}
}for (int i = 0; i < hash.length; i++){
if (hash[i]!=0){char c=(char)i;System.out.print(c);}
}
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/lyric_315/article/details/47656899