gpt4 book ai didi

c++ - 错误 :Expected unqualified-id before ‘{’ token

转载 作者:行者123 更新时间:2023-11-28 02:52:44 25 4
gpt4 key购买 nike

这在我的代码中作为错误弹出。请帮忙!

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;
}
}

最佳答案

bool validData(int id, float exam1, float exam2, float exam3); 

是错误的,不需要分号。

关于c++ - 错误 :Expected unqualified-id before ‘{’ token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22678222/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com