将每个字符出现的次数(顺便找出最小的次数)建立map<字符,次数>,用map里value最小的key去比对str,相同则删除,输出剩下的str。 #include <iostream> #include <algorithm> #include <map> #include <vector> #include <string> using namespace std; int main() { map <char, int> M;//map M用来存储str里出现过的字符和其出现次数 string str, s...