max(max(a,b),c)应该怎么用啊#include#include int main(){int a,b,c;scanf ("%d%d%d",&a,&b,&c);printf ("%d",a+b+c);printf ("%.0lf",(a+b+c)/3);max(max(a,b),c);return 0;}--------------------Configuration:text - Win32 Debug--------------------Compilin

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 13:50:51
max(max(a,b),c)应该怎么用啊#include#include int main(){int a,b,c;scanf (
xSMk@+/+n6- fÊTZ^dN΄[JA*`[PV-3ZO'uoN$5̌7h(&|fw3<7 Gi@_LBQfůJp#`TSȪVXUД?5bQX̘S|T07jc,g!Iʙ+ɲܦlf?4u԰RCcg:CqK`Nױm[|8Kۺ)xG.ܠIZ P-(EWT2iU&D.`v~;Z7e$&iHK^dT*Z#[߸qIvtU#1:CX<'nz={~/߿lg;Vv>gGJv[6g_|g7AD}N(codOJ:ԙjW瀡.I T;AՐHt~RAq&,HfaȄ&i(h zN#,T ͎

max(max(a,b),c)应该怎么用啊#include#include int main(){int a,b,c;scanf ("%d%d%d",&a,&b,&c);printf ("%d",a+b+c);printf ("%.0lf",(a+b+c)/3);max(max(a,b),c);return 0;}--------------------Configuration:text - Win32 Debug--------------------Compilin
max(max(a,b),c)应该怎么用啊
#include
#include
int main()
{
int a,b,c;
scanf ("%d%d%d",&a,&b,&c);
printf ("%d",a+b+c);
printf ("%.0lf",(a+b+c)/3);
max(max(a,b),c);
return 0;
}
--------------------Configuration:text - Win32 Debug--------------------
Compiling...
book.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\text\book.cpp(9) :error C2065:'max' :undeclared identifier
Error executing cl.exe.
book.obj - 1 error(s),0 warning(s)

max(max(a,b),c)应该怎么用啊#include#include int main(){int a,b,c;scanf ("%d%d%d",&a,&b,&c);printf ("%d",a+b+c);printf ("%.0lf",(a+b+c)/3);max(max(a,b),c);return 0;}--------------------Configuration:text - Win32 Debug--------------------Compilin
错误原因:该宏没有定义
#include
使用__max函数代替max
在stdlib.h中有关max定义如下:
/* Non-ANSI names for compatibility */
#ifndef __cplusplus
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif