0
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]),

“错误:预期 ',' 或 ';' 在“{”标记之前”

4

1 回答 1

2
double lowestTempOfYear(MWeather data[12]){
// ...

} //You missed to close the curly brace

还要确保你匹配你的MWeatherMweather吗?和评论一样

于 2013-10-01T20:50:46.100 回答