[求助]这个程序怎么写?----求助!
编写一个程序首先输出提示 "do you want to continue?",然后读取用户输入。如果用户输入为“y","yes","ok","sure","why not",则输出“ok";如果用户输入的是"n","not"则输出”not" 否则输出"input error"不区分大小写!在线等待1!
#include <iostream.h>
#include <string.h>
using namespace std;
int main()
{
string IsContinue;
cout<<"do you want to continue?"<<endl;
cin>>IsContinue;
if (IsContinue == "y" || IsContinue == "Y")
{
cout<<"ok"<<endl;
}
else if (IsContinue == "n" || IsContinue == "N")
{
cout<<"not"<<endl;
}
else
{
cout<<"input error!"<<endl;
}
return 0;
}