- #include <stdio.h>
-
int max(int,int);
-
int main()
-
{
-
int x=1,y=2;
-
printf("%d",max(x,y));
-
return 0;
-
}
-
int max(int x,int y)
-
{
-
-
int buf[2]={x,y};
-
-
unsigned int z;
-
z=x-y;
-
-
z>>=31;
-
-
return buf[z];
-
-
}
---------------------------------
int max=(x+y+abs(x-y))/2;
int min=(x+y-abs(x-y))/2;