double highestTempOfYear(Mweather data[12]){
vector<double> temps;
for(int i = 0; i < 12; i++){
temps.push_back(data[i].high_temperature);
temps.push_back(data[i].low_temperature);
}
return *max_element(temps.begin(),temps.end());
}
double lowestTempOfYear(MWeather data[12]){
vector<double> temps;
for(int i = 0; i < 12; i++){
temps.push_back(data[i].high_temperature);
temps.push_back(data[i].low_temperature);
}
在函数标题的行上,double lowestTempOfYear(MWeather data[12])
,
“错误:预期','或';'在'{'token“之前
答案 0 :(得分:2)
double lowestTempOfYear(MWeather data[12]){
// ...
} //You missed to close the curly brace
另外,请确保您匹配MWeather
是Mweather
吗?如在评论中