[QUOTE][/QUOTE]
以下是引用woshibuhui在2007-9-2 16:42:46的发言:
#include <iostream.h>
void main()
{
char answer;
while(1)
{
cout<<"现在还下雨吗?(Y/N)"<<endl;
cin>>answer;
if(answer=='Y'||answer=='y')
cout<<"现在正在下雨。"<<endl;
elseif(answer=='N'||answer=='n')
{
cout<<"现在没有下雨。"<<endl;
break;
}
else
cout<<"错误的输入!(Y/N)"<<endl;
}
}
把elseif分开 else if