#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
vector<string> v;
v.push_back("A");
v.push_back("B");
v.push_back("C");
cout << v.size() << endl;
for (int i = 0; i < v.size(); ++i)
cout << v[i] << endl;
v[0] = "battle axe";
for (int i = 0; i < v.size(); ++i)
cout << v[i] << endl;
cout << v[0] << endl;
cout << v[0].size() << endl;
v.pop_back();
for (int i = 0; i < v.size(); ++i)
cout << v[i] << endl;
v.clear();
if (v.empty())
cout << "\nYou have nothing.\n";
else
cout << "\nYou have at least one item.\n";
return 0;
}
|