HJ9题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { string input; getline(cin, input); vector<char> vec; for (int i = input.size() - 1; i >= 0; i--) { if (find(vec.begin(), vec.end(), input[i]) == vec.end()) { vec.push_back(input[i]); } } for (auto it : vec) { cout << it; } }#刷题#