c++ if else语句_c++ else前缺少if
问题补充:
{cout<<"请输入你的行动。\n";
cout<<"A.全速前进。\n";
cout<<"B.中速前进。\n";
cout<<"C.全速前进。\n";
cout<<"D.休息一晚。\n";
cout<<"E.查看你的处境。\n";
cout<<"Q.退出游戏。\n";
char p;
cin>>p;
if(p=='a'||p=='A')
{
if (d>0)
d--;
b=0;
else (d=0)
cout<<"你的水壶没有水了请重新选择你的行动。";
}
最佳答案
注意,if后面要加{}的
if (d>0) { //here
d--;
b=0;
} //here
最佳答案由网友 whoami1978 提供
其他回答
暂无其它回答!