C语言:int x=5,y=7,z; z=x>y?5>3?++x+y:x:++x-y++ 则z的值为________.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 12:36:12
C语言:intx=5,y=7,z;z=x>y?5>3?++x+y:x:++x-y++则z的值为________.C语言:intx=5,y=7,z;z=x>y?5>3?++x+y:x:++x-y++则z
C语言:int x=5,y=7,z; z=x>y?5>3?++x+y:x:++x-y++ 则z的值为________.
C语言:int x=5,y=7,z; z=x>y?5>3?++x+y:x:++x-y++ 则z的值为________.
C语言:int x=5,y=7,z; z=x>y?5>3?++x+y:x:++x-y++ 则z的值为________.
int x=5,y=7,z;//x=5,y=7,z=?
z=x>y?5>3?++x+y:x:++x-y++;//此句分解为下面语句
if(x>y)//此条件不成立直接else
{
if(5>3)
{
z=++x+y;
}
else
{
z=x;
}
}
else//运行此句
{
z=++x-y++;
}
上述问题转化为z=++x-y++;
++x的值为x+1
y++的值为y
则问题转化为z=(x+1)-y=6-7=-1
结果为-1