#include <iostream>
int main()
{
std::cout << "You wake up hanging upside down from your parachute, dangling about 15 feet" << std::endl << "in the air." << std::endl << std::endl;
std::cout << "In the distance you see a small cave below a cliff." << std::endl << std::endl;
std::cout << "What do you do?" << std::endl;
std::cout << "1) Scale the cliff" << std::endl;
std::cout << "2) Enter the cave" << std::endl;
}
If you, however, insist in using keypresses instead of regular inputs, you should try the popular NCurses library which is available on the internet, free of charge.
If you are on a Windows system, you might also try the (unpopular) conio.h library.
#include <iostream>
usingnamespace std;
int main (){
int choice;
cout << "What is your favorite number, 1 or 2?" << endl;
cin >> choice;
if (choice == 1) {
cout << "oh, so your favorite number is 1 ey!" << endl;
} ;
if (choice == 2){
cout << "so your favorite number is 2 eyy!" << endl;
}
system("pause");
return 0;
}