提问的时候把代码贴全吧
上一行的 cin>>car.time;的那个分号,是不是全角的。
if/else if分支结构如下:
if(boolean_expression 1) {
// Executes when the boolean expression 1 is true
} else if( boolean_expression 2) {
// Executes when the boolean expression 2 is true
} else if( boolean_expression 3) {
// Executes when the boolean expression 3 is true
} else {
// executes when the none of the above condition is true.
}
注意检查下是否少了最后那个else,再就是检查一下括号是否匹配,是否有不正确拼写的字符。
如果不好定位,可以注释掉部分代码再编译。
如果对您有帮助,请采纳答案好吗,谢谢!