Everyone has this problem. iF you do a search you will find other solutions. i use this.
#include <conio.h> // include this header file
cout << "The world is about to be destroyed. You are in a futuristic spy base." << endl;
cout << "You will soon go on a mission to save the world. In the corner of the room," << endl;
cout << "you see a plant. The door is to the north and the basement is down." << endl;
cin >> firstroom;
if(firstroom == "x plant")
cout << "As you examine the plant, you spot a glint of silver in the soil." << endl;
cin >> plant;
if(plant == "x glint" || "get glint")
cout << "You pick up the glint. It is a keycard to the NETWORK." << endl;
getglint = 1;
cin >> glint;
getch();// add this line it, it waits for any keystroke from user!!!!
Just add the header file and that getch() line in front of your return 0 and it should work. IF not look around and find other ways that people do it.