这在我的代码中弹出是一个错误。请帮忙!
bool validData(int id, float exam1, float exam2, float exam3);
****************************************************
//Purpose: Determine id, exam1, exam2, exam3 are valid or invalid.
//Input: id, exam1, exam2, exam3.
//Precondition: id, exam1, exam2, exam3 are assigned values.
//Output: bool.
//Post condition: This function returns true if all data are valid, otherwise return false.
//Note: None.
****************************************************
{
if (( id <= MAXID && id >= MINID) && (exam1 <= MAXEXAM && exam1 >= MINEXAM) && (exam2 <= MAXEXAM
&& exam2 >= MINEXAM) && (exam3 <= MAXEXAM && exam3 >= MINEXAM)) {
return true;
} else {
return false;
}
}
答案 0 :(得分:2)
bool validData(int id, float exam1, float exam2, float exam3);
错误,不需要分号。