From 5e39adead80f85f87e5f34ce85636c0d0ef063a7 Mon Sep 17 00:00:00 2001 From: smallkun Date: Thu, 20 Mar 2025 10:33:39 +0800 Subject: [PATCH] 2025-03-20 --- 2207/C语言同步练习源码/6-预处理-2.c | 11 +++++++++++ 2207/C语言同步练习源码/6-预处理-3.c | 0 2207/C语言同步练习答案.md | 12 ++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 2207/C语言同步练习源码/6-预处理-2.c create mode 100644 2207/C语言同步练习源码/6-预处理-3.c diff --git a/2207/C语言同步练习源码/6-预处理-2.c b/2207/C语言同步练习源码/6-预处理-2.c new file mode 100644 index 0000000..46ae253 --- /dev/null +++ b/2207/C语言同步练习源码/6-预处理-2.c @@ -0,0 +1,11 @@ +#include +#define f(n) (n%5==0 && n%7==0?"能被整除\n":"不能被整除\n") +int main(){ + //#define 指令 语句序列 会在语句序列中将所有参数替换成传入的 + int num; + scanf("%d", &num); + + puts(f(num)); + + return 0; +} \ No newline at end of file diff --git a/2207/C语言同步练习源码/6-预处理-3.c b/2207/C语言同步练习源码/6-预处理-3.c new file mode 100644 index 0000000..e69de29 diff --git a/2207/C语言同步练习答案.md b/2207/C语言同步练习答案.md index 9cae841..2efdaa4 100644 --- a/2207/C语言同步练习答案.md +++ b/2207/C语言同步练习答案.md @@ -887,7 +887,19 @@ int main(){ ### 预处理-2 ![image-20250227231314793](https://yp.smallkun.cn/markdown/image-20250227231314793.png!compress) +```c +#include +#define f(n) (n%5==0 && n%7==0?"能被整除\n":"不能被整除\n") +int main(){ + //#define 指令 语句序列 会在语句序列中将所有参数替换成传入的 + int num; + scanf("%d", &num); + puts(f(num)); + + return 0; +} +``` ### 预处理-3