#include<iostream> #include<string> #include<set> using namespace std; int main() { int n; while(cin>>n) { set<int> s; while(n) { int temp = n%10;//取到最后一个数字 if(s.find(temp) == s.end())//s中放入的都是没有重复的数字,并且最后一个数字都是最后放进入的。 { cout<<temp; } n/=10; s.insert(temp);//set中不能插入重复的数字。 } cout<<endl; } }