|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
A错,赋值左边不能是表达式
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int d,e,f;
- d=9+e+f=d+9;
-
- printf("%d\n",d);
-
- return 0;
- }
复制代码
报错 [Error] lvalue required as left operand of assignment
B.不理解,e是0吗?
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int d,e,f;
- d=9+e,f=d+9;
-
- printf("%d\n%d\n",d,f);
-
- return 0;
- }
复制代码
输出9,18
C.
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int d,e,f;
- d=9+e,e++,d+9;
-
- printf("%d\n",d);
-
- return 0;
- }
复制代码
1.为什么不符合语法还能输出?
2.e是0吗?最后为什么输出9?
D
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int d,e,f;
- d=9+e++=d+7;
-
- printf("%d\n",d);
-
- return 0;
- }
复制代码
报错 [Error] lvalue required as left operand of assignment |
|