From 6b6d78b340407bbbfd1ef2fb11c4677a18af89c5 Mon Sep 17 00:00:00 2001 From: smallkun Date: Thu, 20 Mar 2025 10:29:51 +0800 Subject: [PATCH] 2025-03-20 --- 2207/C语言同步练习源码/6-预处理-1.c | 11 +++++++++++ 2207/C语言同步练习答案.md | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 2207/C语言同步练习源码/6-预处理-1.c diff --git a/2207/C语言同步练习源码/6-预处理-1.c b/2207/C语言同步练习源码/6-预处理-1.c new file mode 100644 index 0000000..32b4bf4 --- /dev/null +++ b/2207/C语言同步练习源码/6-预处理-1.c @@ -0,0 +1,11 @@ +#include +#define MAXD(x, y) (x>y?x:y) + +int main(){ + int a, b; + scanf("%d %d", &a, &b); + //(1>2?1:2) 将MAXD替换成三目运算符 + printf("%d \n", MAXD(a, b)); + + return 0; +} \ No newline at end of file diff --git a/2207/C语言同步练习答案.md b/2207/C语言同步练习答案.md index 3c1f595..9cae841 100644 --- a/2207/C语言同步练习答案.md +++ b/2207/C语言同步练习答案.md @@ -870,7 +870,19 @@ int main(){ ![image-20250227231302316](https://yp.smallkun.cn/markdown/image-20250227231302316.png!compress) +```c +#include +#define MAXD(x, y) (x>y?x:y) +int main(){ + int a, b; + scanf("%d %d", &a, &b); + //(1>2?1:2) 将MAXD替换成三目运算符 + printf("%d \n", MAXD(a, b)); + + return 0; +} +``` ### 预处理-2