forked from ChicoState/MyFave
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (27 loc) · 670 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (27 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <vector>
using std::cout, std::cin, std::endl, std::string, std::vector;
int main()
{
string input = "";
vector <string> favorites;
cout << "At any time, type DONE to stop recording favorites.\n";
do
{
if( favorites.size() == 0 )
cout << "What is your favorite?\n";
else
cout << "What is your next favorite?\n";
getline(cin,input);
if(input != "DONE"){
favorites.push_back(input);
}
//favorites.push_back(input);
}while( input != "DONE" );
cout << "Your favorite list:\n";
for(int i = 0; i < favorites.size(); i++)
{
cout << favorites.at(i) << endl;
}
return 0;
}