a=b=c=0;x=35; if(!a)x--;else if(b);if(c)x=3;else x=4 中的 if(!
1个回答

#include

int main()

{

x05int a,b,c,x;

x05a=b=c=0;

x=35;

if(!a) x--; // 因为a = 0,所以!a 不等于 0 ==> if(!a) 为真 ,执行 x--

else if(b); // 确定这里有分号吗?(如果这里没有分号)请看我下面的~

x05printf("%dn",x); //x = 34

if(c) x=3; // c = 0;所以if(c) 为假,执行 x = 4

else x=4;

x05printf("%dn",x); // x = 4

x05return 0;

}

//

#include

int main()

{

x05int a,b,c,x;

x05a=b=c=0;

x=35;

if(!a) x--;

else if(b)

x05x05 if(c) x=3; else x=4; //这里是if的嵌套 ,和下面我加括号是等价的

/*x05if(!a)

x05{

x05x05x--;

x05}

x05else //下面的整个else都不会被执行

x05{

x05x05if(b)

x05x05{

x05x05x05if(c) x=3; else x = 4;

x05x05}

x05} */

x05printf("%dn",x); // x = 34

x05return 0;

}