小编Hoa*_*g.T的帖子

逻辑运算符的基本编程练习

我的书中有一个问题:

#include<stdio.h>
void main()
{
    int a=5, b=-7, c=0, d;
    d = ++a && ++b || ++c;
    printf("\n%d%d%d%d",a,b,c,d);
}
Run Code Online (Sandbox Code Playgroud)

这个问题问我代码的输出是什么.我跑了,屏幕上的结果是6-601.我明白为什么a=6b=-6,但我不明白为什么c=0d=1

c logical-operators

6
推荐指数
2
解决办法
761
查看次数

标签 统计

c ×1

logical-operators ×1