#include <stdio.h>
int main()
{
int a = 0;
int b = 1;
int c = 2;//逗号表达式要写上完整的式子!每个式子我都忘写等于谁了
int d = (a = a + 1, c = c + a, b = b + c);//逗号表达式是从左到右依次计算的。
//(a + 1=0+1=1此时a=1, c + a=2+1=3//此时c=3, b+c=1+3=4,此时b=4)
printf("%d\n", d);//整个逗号表达式的结果是最后一个表达式的结果
return 0;
}
04-09
336
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交