解题思路:
注意事项:
参考代码:
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #include <map> using namespace std; map<char, int> rec; int main() { string str; cin >> str; for (string::iterator it = str.begin(); it < str.end(); it++) rec[*it] += 1; for (string::iterator it = str.begin(); it < str.end();) { if (rec[*it] > 1) it = str.erase(it); else it++; } cout << str << endl; return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:652 |
C语言程序设计教程(第三版)课后习题6.2 (C++代码)为什么回车不算字符浏览:1186 |
点我有惊喜!你懂得!浏览:972 |
2005年春浙江省计算机等级考试二级C 编程题(3),复杂度最低的方法没有之一!!!!!浏览:808 |
矩形面积交 (Java代码)浏览:1214 |
人见人爱A+B (C语言代码)浏览:628 |
WU-蓝桥杯算法提高VIP-企业奖金发放 (C++代码)浏览:1166 |
【简单计算】 (C语言代码)浏览:622 |
Hello, world! (C语言代码)浏览:714 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:588 |