Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <vector>
- #include <string>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv)
- {
- vector<string> v;
- int i = 0;
- /*v.push_back('a');
- v.push_back('b');
- v.push_back('c');
- v.insert(v.begin(), 'd', 'e');
- v.erase(v.begin());
- v.insert(v.begin(), 'f');
- v.pop_back();
- for(i = 0; i < v.size(); i++)
- cout << v[i] << "";
- cout << endl;
- cout << "front = " << v.front() << endl;
- cout << "back = " << v.back() << endl;
- cout << "size = " << v.size() << endl;
- */
- while (1)
- {
- string a;
- cout << "Podaj slowo numer " << i+1 << endl;
- cin >> a;
- v.push_back(a);
- i=i+1;
- if(a == ".")
- {
- break;
- }
- if (v.end() == v.end()-1){
- v.erase(v.end());
- }
- }
- for(i = 0; i < v.size(); i++)
- cout << v[i] << " ";
- cout << endl;
- system("PAUSE");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement