初始C语言(宏定义最大最小值)

#include <stdio.h>
#define MAX(a,b) (a>b?a:b) //定义最大值属性,下面主程序中无需再次定义或声明.
int main()
{
int a,b,max;
scanf ("%d",&a);
scanf ("%d",&b);
max=MAX(a,b);
printf ("MAX IS %d\n",max);
return 0;
}


猜你喜欢

转载自blog.51cto.com/15144773/2670777