1 Star 0 Fork 0

徒步天下 / C语言解惑

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
4_1.c 738 Bytes
一键复制 编辑 原始数据 按行查看 历史
徒步天下 提交于 2017-10-11 21:17 . 更新 4_1.c
/* 4.1 if语句
*/
#include <stdio.h>
#define PR(fmt, val) printf(#val " = %" #fmt "\t", (val))
#define NL putchar ('\n')
#define PRINT1(f,x1) PR(f,x1), NL
#define PRINT2(f,x1,x2) PR(f,x1), PRINT1(f,x2)
#define PRINT3(f,x1,x2,x3) PR(f,x1), PRINT2(f,x2,x3)
#define PRINT4(f,x1,x2,x3,x4) PR(f,x1), PRINT3(f,x2,x3,x4)
int main()
{
int x, y=1, z;
if (y!=0) x=5;
PRINT1(d,x);
if (y==0) x=3;
else x=5;
PRINT1(d,x);
x=1;
if (y<0) if (y>0) x=3;
else x=5;
PRINT1(d,x);
if (z=y<0) x=3;
else if (y==0) x=5;
else x=7;
PRINT2(d,x,z);
if (z=(y==0)) x=5;
x=3;
PRINT2(d,x,z);
if (x=z=y); x=3;
PRINT2(d,x,z);
return 0;
}
C
1
https://gitee.com/se17a/The_C_Puzzle_Book.git
git@gitee.com:se17a/The_C_Puzzle_Book.git
se17a
The_C_Puzzle_Book
C语言解惑
master

搜索帮助