Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- using namespace std;
- int main()
- {
- vector<string> my_strings;
- for (int i=0; i < 5; i++){
- cout << i << ": ";
- string s;
- getline(cin, s);
- my_strings.push_back(s);
- if (s.empty()){
- break;
- }
- }
- for (int i=0; i < my_strings.size(); i++){
- cout << my_strings[i] << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement