HJ9题解 | #提取不重复的整数#
提取不重复的整数
https://www.nowcoder.com/practice/253986e66d114d378ae8de2e6c4577c1
#include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; int main() { string str; vector<int> ve(10, 0); cin>>str; reverse(str.begin(), str.end()); for (int i=0; i<str.size(); i++) { if(ve[(int)(str[i])] == 0) { cout<<str[i]; ve[(int)(str[i])] = 1; } } }