C++ Primer(第5版) 练习 11.32 练习 11.32 使用上一题定义的multimap编写一个程序,按字典打印作者列表和他们的作品。 环境:Linux Ubuntu(云服务器) 工具:vim 代码块 /*************************************************************************> File Name: ex11.32.cpp> Author: > Mail: > Created Time: Mon 08 Apr 2024 08:15:11 AM CST************************************************************************/#include<iostream> #include<iomanip> #include<string> #include<map> #include<iterator> using namespace std;int main(){multimap<string, string> author;string name, book;cout<<"Enter author name and book name: "<<endl;while(getline(cin, name) && getline(cin, book)){author.insert({name, book});}cout<<endl;cout<<"List: "<<endl;for(const auto a : author){cout<<setw(15)<<left<<a.first<<" "<<a.second<<endl;}cout<<endl;return 0; } 运行结果显示如下