• Source
    1. #include <iostream>
    2. #include <vector>
    3. using namespace std;
    4.  
    5. int main() {
    6. std::string progid;
    7. std::string clsid;
    8. vector<std::pair<std::string,std::string>> ids;
    9.  
    10. while(cin >> progid >> clsid ) {
    11. auto id = std::make_pair(progid,clsid);
    12. ids.push_back(id);
    13. }
    14. for(std::vector<std::pair<std::string,std::string>>::iterator it = ids.begin(); it != ids.end(); ++it) {
    15. progid = it->first;
    16. clsid = it->second;
    17. std::cout << "progid:" << it->first << " clsid:" << it->second <<endl;
    18. //std::cout << *(it.first) <<endl;
    19. }
    20. return 0;
    21.  
    22. }