求解,为什么dev-c++max函数用不了
查看原帖
求解,为什么dev-c++max函数用不了
1635698
LieHaWW楼主2025/1/10 13:32
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n,s1,m1,s2,m2,s3,m3,a,b,c,m;
	cin >>n>>s1>>m1>>s2>>m2>>s3>>m3;
	a=n/s1;
	if(n%s1!=0)
	a+=1;
	b=n/s2;
	if(n%s2!=0)
	b+=1;
	c=n/s3;
	if(n%s3!=0)
	c+=1;
	cout << max(a*m1,b*m2,c*m3);
	return 0;
}

报错是:264 26 C:\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\stl_algobase.h [Error] '__comp' cannot be used as a function

加了大括号,就是max({a,b,c})也不行,报错是:16 30 D:\DESK\洛谷\能力提升综合题单Part1 入门阶段\P1909 买铅笔.cpp [Error] no matching function for call to 'max()'

2025/1/10 13:32
加载中...