#include<stdio.h>
#include<math.h>
#define MAX(A,B) (A+B+abs(A-B))/2
int main()
{
int a=7,b=10,max;
printf("a=%d b=%d\n",a,b);
max=MAX(a,b);
printf("max=%d\n",max);
return 0;
#include<math.h>
#define MAX(A,B) (A+B+abs(A-B))/2
int main()
{
int a=7,b=10,max;
printf("a=%d b=%d\n",a,b);
max=MAX(a,b);
printf("max=%d\n",max);
return 0;
}
输出结果
a=7 b=10
max=10
Press any key to continue
#include<stdio.h>
int main()
{
int i=1,j=1,m=1,n=1,a=1,b=1;
if((m=(a>b))&&(n=(a>b)));
printf("m=%d n=%d ",m,n);
printf("(n++)=%d ",n++);
printf("n=%d ",n);
m=(a+b+a,n++) ;
printf("m=%d ",m);
i+=j+=3;
printf("i=%d ",i);
return 0;
}
输出结果
m=0 n=1 (n++)=1 n=2 m=2 i=5 Press any key to continue