在线等待1!
简化了对用户输入的判断,需要的话,LZ自己修改一下吧!(VC6.0通过)
#include<iostream>
#include<string>
using namespace std ;
void main()
{
string IsContinue ;
cout << "do you want to continue? " ;
cin >> IsContinue ;
if(IsContinue == "y" || IsContinue == "Y")
cout << "ok" << endl ;
else if(IsContinue == "n" || IsContinue == "N")
cout << "not" << endl ;
else
cout << "input error!" << endl ;
}
[此贴子已经被作者于2007-7-24 16:59:07编辑过]