#include<iostream> #include<string> #include<map> using namespace std; int main() { // c++ 里面的map容器的迭代器里面 有個first 和 second,分別指向鍵值和數值 map<string ,string> p; p["one"]="first"; map<string,string>::iterator key=p.begin(); string a=key->first; string b=key->second; cout<<a<<" "<<b; //輸出one first system("pause"); return 0; }
浙公網安備 33010602011771號