- //文件名:CHAPTER6-4.cpp
- #pragma warning(disable:4786)
- #include <string>
- #include <vector>
- #include <iostream>
- using namespace std;
- void main ()
- {vector<string> Myvector;
- Myvector.push_back("Chocolate");
- Myvector.push_back("Strawberry");
- Myvector.push_back("Lime");
- Myvector.push_back("Vanilla");
- for(int i=0;i<4; i++)
- cout<<Myvector[i]<<" ";
- }