为什么最后z不等于0
# include<stdio.h>
void main ( )
{ int x = 1 , y = - 1 , z = 3 ;
if ( x < y )
if ( y < 0 ) z = 0 ;
else z = z + 1 ;
printf ( " %d \n ", z );
}
# include<stdio.h>
void main ( )
{ int x = 1 , y = - 1 , z = 3 ;
if ( x < y )
if ( y < 0 ) z = 0 ;
else z = z + 1 ;
printf ( " %d \n ", z );
}
这样看,if(y<0)是在if(x<y)里面的,但是x<y不成立,所以就不往下执行了,z还是3