/****************
关系和逻辑运算:
最高 !
> >= < <=
== !=
&&
最低 ||
****************/
#include <stdio.h>
int main()
{
int logic;
int a = 1;
int b = 2;
int c = 3;
logic = a+b>c&&b<=c;
printf("logic = %d\n",logic); //0
logic = a>=b+c||b==c;
printf("logic = %d\n",logic);//0
logic = !(a<c)+b!=1&&(a+c)/2;
printf("logic = %d\n",logic);//1
while(1);
return 0;
}
|