我建立一个控制台应用程序,在C++中,我想有两件事情:当用户在C++控制台应用程序中输入“退出”时,如何退出应用程序?
- 当有人输入单词“退出”,退出控制台,
- 当有人输入“SHOWME”表现出我制作的字符串。
我试图让这个
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
using namespace std;
int answer;
cout << "What do you want to learn?" << endl;
cin << answer << endl;
if answer == "show"
cout << "You have been shown the light" << endl;
if answer == "exit"
exit.window
这就是我想象中的代码是,但如果有人可以请帮助,我对我的第4个C++课。 在此先感谢。
引用我认为你已经错过了前3周C++的经验教训。 –
@KirilKirov:我在想(希望)这是为了伪代码。 –
@BenVoigt - 我也希望如此,:) –