- #include <iostream>
- #include <string>
- #include <utility>
- #include <vector>
- using namespace std;
- int main(int argc,char **argv)
- {
- pair<string,int> user;
- vector< pair<string,int> > users;
- while(cin>>user.first>>user.second)
- {
- users.push_back(user);
- }
- for(vector<pair<string,int>>::iterator iter=users.begin();
- iter!=users.end();++iter)
- {
- cout<<"user name is:"<<iter->first
- <<" user number is:"<<iter->second<<endl;
- }
- return 0;
- }
c++ primer 习题10.1
最新推荐文章于 2024-08-19 18:41:12 发布