编译不成功?
在vc中编译成功了 这里怎么编译不成功呢?
在vc中编译成功了 这里怎么编译不成功呢?
2016-04-17
#include <vector>
#include <map>
#include <string>
#include <iostream>
using namespace std;
int main(void)
{
vector<int> vec;
vec.push_back(3);
vec.push_back(6);
vec.push_back(8);
vec.push_back(4);
vector<int>::iterator itor;
for ( itor = vec.begin(); itor != vec.end(); itor++)
{
cout << *itor << endl;
}
map<string, string> m;
pair<string, string> p1("S", "ShangHai");
pair<string, string> p2("B", "BeiJing");
pair<string, string> p3("G", "GuangZhou");
m.insert(p1);
m.insert(p2);
m.insert(p3);
map<string, string>::iterator itor1;
for ( itor1 = m.begin(); itor1 != m.end(); itor1++)
{
cout << itor1->first << endl;
cout << itor1->second << endl;
}
return 0;
}
举报