-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_5 = Fav Game.cpp
45 lines (32 loc) · 985 Bytes
/
A_5 = Fav Game.cpp
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
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<string> Fav_Game;
// ask the player how many games?
int numgame;
cout << "How many Game Do you want to Add ?";
// store that number
cin >> numgame;
//cout << numgame;
// create a while loop that runs that many times
int num = 0;
while(num > numgame)
cout << "Enter the name of the game: ";
// for( int i = 0; i < numGAmes, i++)
for( int i = 0; i < numgame; i++)
{
string game;
cout << "Enter Game " << i + 1 << ":\n";
cin >> game;
Fav_Game.push_back(game);
}
cout << "Here is the list of the game that you like\n";
for (int x = 0; x < Fav_Game.size(); x += 1)
{
cout << x + 1 << " : " << Fav_Game[x] << "\n";
}
return 0;
}