题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
#include <algorithm> #include <iostream> #include <iterator> #include <unordered_set> using namespace std; #include <set> int main() { int n; cin>>n; unordered_set<int> s; while(n!=0){ if(s.find(n%10)==s.end()){ s.insert(n%10); cout<<n%10; } n=n/10; } } // 64 位输出请用 printf("%lld")