这是我正在使用的声明,但它表示没有匹配函数来调用'max'
max((used_minutes-Included_Minutes)*extra_charge,0)
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.
编辑
码
int used_minutes; const int Included_Minutes = 300;
double total_charge, extra_charge;
cout << "Enter the number of phone call minutes: ";
cin >> used_minutes;
cout <<"Number of phone call minutes used - included in the base plan: " << min(used_minutes,Included_Minutes) << endl;
cout <<"Number of phone call minutes used - not included in the base plan: "<< max(used_minutes-Included_Minutes,0) << endl;
extra_charge = 0.10;
cout <<"Cost of excess phone call minutes: $"<<fixed << setprecision(2) << max(used_minutes-Included_Minutes)*extra_charge, 0) …Run Code Online (Sandbox Code Playgroud)