条件、判断语句
1.if
2.switch
1.if(if else只能处理2种情况,if else if可以处理多种情况)
int msin(){
//if(false){
//cout<<"if语句"<<endl;
}
//bool isDead=true;
//if(isDead){
//cout<<"游戏结束处理"<<endl;
}
//bool isVip=false;
//if(isVip){
//cout<<"限时打折后的价格"<<endl;
}
//else{
//cout<<"显示正常的价格"<<endl;
}
int vip=1;
if(vip==1){
cout<<"打几折"<<endl;
}
else if(vip==2){
cout<<"打八折"<<endl;
}
else if(vip==3){
cout<<"打七折"<<endl;
}
else {
cout<<"不打折"<<endl;
}
cout<<"if语句之后"<<endl;
return 0;
}