题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; unordered_set<int> uset; int res = 0; while(a > 0){ int num = a % 10; a /= 10; if(uset.find(num) != uset.end()){ continue; } else{ res = res*10 + num; uset.insert(num); } } cout << res << endl; }