题解 | 提取不重复的整数
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
#include <iostream>
#include <string>
#include <algorithm>
#include <unordered_set>
using namespace std;
int main() {
string a,b;
cin >> a;
reverse(a.begin(),a.end());
unordered_set<char> seen;
for(char c:a)
{
if(seen.find(c)==seen.end())
{
seen.insert(c);
b +=c;
}
}
cout << b;
}
// 64 位输出请用 printf("%lld")
查看14道真题和解析