最近新发现了一个问题,希望各位帮忙
c语言吧
全部回复
仅看楼主
level 11
498264111l 楼主
#incude <stdio.h>
void main(){
int x,y,z;
x=y=z=0;
x++||y++&&z++;
printf("%d,%d,%d",x,y,z);
}
答案是1,0,0
这是为什么呢?
2013年04月18日 16点04分 1
level 13
短路或
2013年04月18日 16点04分 2
level 10
X++其值为1后面的语句被短路,没有参加运算,所以原样输出!
2013年04月18日 20点04分 3
不是应该先进行与运算吗
2013年04月18日 23点04分
1