网站设计的公司企业邮箱,微信公众号微信公众平台,自媒体账号申请,盐山做网站价格老师在上课的时候讲过这道题#xff0c;不过当时做这道题时还是纠结了许久#xff0c;那时stl不熟#xff0c;老是想着用数组#xff0c;去重很麻烦#xff0c;学了STL后#xff0c;用map就简单多了。code #xff1a;#include iostream#include string…老师在上课的时候讲过这道题不过当时做这道题时还是纠结了许久那时stl不熟老是想着用数组去重很麻烦学了STL后用map就简单多了。code #include iostream#include string#include mapusing namespace std;int main() { map string, int m; string a, k; int n, max; while (cin n n) { m.clear(); while (n--) { cin a; m[a]; } map string, int ::iterator it; max 0; for (it m.begin(); it ! m.end(); it) { if ((*it).second max) //遍历寻找最大的气球数 { max (*it).second; k (*it).first; } } cout k endl; } return 0;}