Skip to content

Commit

Permalink
Merge pull request ChicoState#3 from ChicoState/refactor
Browse files Browse the repository at this point in the history
Refactor 'list' as more descriptive 'favorites'
  • Loading branch information
kbuffardi authored Sep 25, 2024
2 parents fc7e124 + 6267dc6 commit fdf326f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ using std::cout, std::cin, std::endl, std::string, std::vector;

int main(){
string input = "";
vector<string> list;
vector<string> favorites;

do{
if( list.size() == 0 ){
if( favorites.size() == 0 ){
cout << "What is your favorite?\n";
}
else{
cout << "What is your next favorite?\n";
}
cin >> input;
list.push_back(input);
favorites.push_back(input);
}while( input != "done" );

cout << "Your favorite list:\n";
for(int i = 0; i < list.size(); i++){
cout << list.at(i) << endl;
for(int i = 0; i < favorites.size(); i++){
cout << favorites.at(i) << endl;
}

return 0;
Expand Down

0 comments on commit fdf326f

Please sign in to comment.