两种方法求Int最值

来源:互联网 时间:1970-01-01

#include <stdio.h>
int main()
{
unsigned int temp;
int Max,Min;

Min=0x7fffffff+1;
Max=0x7fffffff;
printf("IntMax is %d/n",Max);
printf("IntMin is %d/n",Min);

temp=(unsigned int)-1;
Max=temp>>1;
Min=~(temp>>1);
printf("IntMax is %d/n",Max);
printf("IntMin is %d/n",Min);
return 0;
}


相关阅读:
Top