简化 max 定义
#include<stdio.h>#define MAX(a,b,c,d) (((a>b?a:b)>d?(a>b?a:b):d)>c?((a>b?a:b)>d?(a>b?a:b):d):c);
int main(void)
{
//first part
long a,b,c,d,g;
printf("gave me some number for abcd : : : : \n");
scanf("%ld %ld %ld %ld",&a,&b,&c,&d);
//second part
g=MAX(a,b,c,d);
printf("the bigest one is %ld\n\\n",g);
return 0;
}
请问在比较多个数字大小时有没有更简单的方法对MAX进行定义!(新手快自学到指针了!谢谢)