平时都在用if对switch语句有所遗忘,复习一下:
多分枝选择结构
switch(grade)
{
case:'A':cout<<" ";
case:'B':cout<<" ";
}
需要跳出时加break;
case:'A':cout<<" ";break;
平时都在用if对switch语句有所遗忘,复习一下:
多分枝选择结构
switch(grade)
{
case:'A':cout<<" ";
case:'B':cout<<" ";
}
需要跳出时加break;
case:'A':cout<<" ";break;