From f5b37a17c9ad4e92fb603f19eea2794ee98ba309 Mon Sep 17 00:00:00 2001 From: Chiyo Yuki Date: Mon, 17 Nov 2025 19:34:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E8=BD=AF=E4=BB=B6=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=E5=AD=A6=E9=99=A2-=E7=A8=8B=E5=BA=8F=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=9F=BA=E7=A1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anaesthesia <2624815564@qq.com> --- .../程序设计基础/2025-2026-1_期中_张泉.md | 127 ++++++++++++++++++ .../程序设计基础/2025-2026-1_期中_邬海琴.md | 85 ++++++++++++ 2 files changed, 212 insertions(+) create mode 100644 docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md create mode 100644 docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md diff --git a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md new file mode 100644 index 0000000..47476b9 --- /dev/null +++ b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md @@ -0,0 +1,127 @@ +--- +title: 2025-2026学年春季期期中(zq) +--- + +## 一、判断(16 分) + +1. 变量定义可以数字开头 +2. C 语言是面向过程的语言 +3. `(x % 2 == 0) && (6 <= x <= 10)` 表示 $[6,10]$ 的偶数 +4. 逻辑顺序,代码紧凑,符合书写规范 +5. 假定 `a, b` 是 `double` 类型。`printf("%lf", (a = 2, b = a + 3 / 2))` 输出是 `3.000000` + +## 二、读代码(25 分) + +1. ```c + #include + int main() { + int a = 3, b = 4; + a += b *= a + b; + printf("a=%d", a); + } + ``` + + a=\_\_\_\_ + +2. ```c + #include + void Anaesthesia(int b) { + static int a = 0; + a += b; + } + int main() { + Anaesthesia(5); + Anaesthesia(5); + printf("a=%d", a); + } + ``` + + a=\_\_\_\_ + +3. ```c + #include + int main() { + c = 'A' + 4 - 'Z' + 'z'; + d = 'A' + '8' - '5'; + printf("%c %d", c, d); + } + ``` + + \_\_\_\_, \_\_\_\_ + +4. ```c + #include + int main() { + int a = 2; + char b; + double Pi = 3.14; + printf("%d %lf", sizeof(a*b), Pi+8/3); + } + ``` + + \_\_\_\_, \_\_\_\_ + +5. ```c + #include + int main() { + int a = 5, b = 10, c = 15; + if((a -= 5) || (b = a) && (c -= 1)) { + c += 5; + } else { + c -= 5; + } printf("%d", c); + } + ``` + + \_\_\_\_ + +## 三、选择题(25分)(注:题面暂缺) + +函数不允许嵌套定义函数(函数里不可以定义函数) + +编译成功一定运行一定成功 + +变量定义是下划线、字母、数字随意组合 + +3. 正确的是() + A. `char` 可以取余 + B. `(a = 3, b = 5, a + b)` 的值是 $3$ + C. `i++` 和 `++i` 任何情况下都一样 + D. 赋值运算符优先级高于所有基本运算符 + +## 四、手写代码(35 分) + +1. 定义一个常量 $E=2.71828$, 输出 $E^3$ (保留五位小数) + + **Input** + + > 无 + + **Output** + + > `20.08553` + +2. 给入一个值 `n`, 打出表格 + + **Input** + + > `4` + + **Output** + + > ```text + > ***# + > **#* + > *#** + > #*** + > ``` + +3. 输入一个字母,小写转大写,大写转小写 + + **Input** + + > `a` + + **Output** + + > `A` diff --git a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md new file mode 100644 index 0000000..3f843a7 --- /dev/null +++ b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md @@ -0,0 +1,85 @@ +--- +title: 2025-2026学年春季期期中(whq) +--- + +## 一、选择(20 分) 10道 + +函数可以没有返回值 + +实参形参必须完全一致 + +函数里不允许嵌套定义函数 + +## 二、填空(20 分) + +1. 静态变量关键词\_\_\_\_,常态变量关键词\_\_\_\_ + +2. ```c + #include + int main() { + int a = 3, b = 2; + float c = 3 * 5 / b; + printf("%.2f",c); + } + ``` + \_\_\_\_ + +3. `a = 9, b = 2`,`!(a * 2 % 4) && (c = 2) || (7 - 2 * b > 2)` 输出\_\_\_\_ + +4. `unsigned int` 取值多少 \_\_\_\_ + +5. `short arr[11];` 占用\_\_\_\_ bit(s) + +## 三、判断输出(20 分) + +1. ```c + #include + int main() { + int row = 3, col = 4, i, j; + for(i = 0; i < row; i++) { + printf("#"); + for(j = 0; j < col; j ++) { + if(i == j) break; + if(i == col - j) continue; + printf("*"); + } + printf("\n"); + } + return 0; + } + ``` + +2. ```c + #include + #define SQUARE(x) x*x + int main() { + int a = 5; + int b = SQUARE(a + 1); + printf("SQUARE(a+1):%d",b); + return 0; + } + ``` + +## 四、手写代码(40 分) + + +1. 求五个数中的中位数 + + **Input** + + > `5 2 4 3 1` + + **Output** + + > `3` + +2. 求 `100~999` 的素数水仙花数,如果没有,输出`No Such Number.` + + **Input** + + > 无 + + **Output** + + > `No Such Number.` + From 6f1bdc982670172dc99747b2d96ffebc15762c2b Mon Sep 17 00:00:00 2001 From: KirisameVanilla <118162831+kirisamevanilla@users.noreply.github.com> Date: Thu, 20 Nov 2025 23:33:21 +0800 Subject: [PATCH 2/4] fix: some format --- .../程序设计基础/2025-2026-1_期中_张泉.md | 29 ++++++++++--------- .../程序设计基础/2025-2026-1_期中_邬海琴.md | 25 ++++++++-------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md index 47476b9..2b9a8d9 100644 --- a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md +++ b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md @@ -1,5 +1,5 @@ --- -title: 2025-2026学年春季期期中(zq) +title: 2025-2026学年春季期期中(张泉) --- ## 一、判断(16 分) @@ -12,7 +12,9 @@ title: 2025-2026学年春季期期中(zq) ## 二、读代码(25 分) -1. ```c +1. a=\_\_\_\_ + + ```c #include int main() { int a = 3, b = 4; @@ -20,10 +22,10 @@ title: 2025-2026学年春季期期中(zq) printf("a=%d", a); } ``` - - a=\_\_\_\_ -2. ```c +2. a=\_\_\_\_ + + ```c #include void Anaesthesia(int b) { static int a = 0; @@ -36,9 +38,9 @@ title: 2025-2026学年春季期期中(zq) } ``` - a=\_\_\_\_ +3. \_\_\_\_, \_\_\_\_ -3. ```c + ```c #include int main() { c = 'A' + 4 - 'Z' + 'z'; @@ -47,9 +49,9 @@ title: 2025-2026学年春季期期中(zq) } ``` - \_\_\_\_, \_\_\_\_ +4. \_\_\_\_, \_\_\_\_ -4. ```c + ```c #include int main() { int a = 2; @@ -59,9 +61,9 @@ title: 2025-2026学年春季期期中(zq) } ``` - \_\_\_\_, \_\_\_\_ +5. \_\_\_\_ -5. ```c + ```c #include int main() { int a = 5, b = 10, c = 15; @@ -69,12 +71,11 @@ title: 2025-2026学年春季期期中(zq) c += 5; } else { c -= 5; - } printf("%d", c); + } + printf("%d", c); } ``` - \_\_\_\_ - ## 三、选择题(25分)(注:题面暂缺) 函数不允许嵌套定义函数(函数里不可以定义函数) diff --git a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md index 3f843a7..5325a15 100644 --- a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md +++ b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_邬海琴.md @@ -1,5 +1,5 @@ --- -title: 2025-2026学年春季期期中(whq) +title: 2025-2026学年春季期期中(邬海琴) --- ## 一、选择(20 分) 10道 @@ -12,9 +12,11 @@ title: 2025-2026学年春季期期中(whq) ## 二、填空(20 分) -1. 静态变量关键词\_\_\_\_,常态变量关键词\_\_\_\_ +1. 静态变量关键词\_\_\_\_,常态变量关键词\_\_\_\_ -2. ```c +2. \_\_\_\_ + + ```c #include int main() { int a = 3, b = 2; @@ -22,17 +24,16 @@ title: 2025-2026学年春季期期中(whq) printf("%.2f",c); } ``` - \_\_\_\_ -3. `a = 9, b = 2`,`!(a * 2 % 4) && (c = 2) || (7 - 2 * b > 2)` 输出\_\_\_\_ +3. `a = 9, b = 2`,`!(a * 2 % 4) && (c = 2) || (7 - 2 * b > 2)` 输出\_\_\_\_ -4. `unsigned int` 取值多少 \_\_\_\_ +4. `unsigned int` 取值多少 \_\_\_\_ -5. `short arr[11];` 占用\_\_\_\_ bit(s) +5. `short arr[11];` 占用\_\_\_\_ bit(s) ## 三、判断输出(20 分) -1. ```c +1. ```c #include int main() { int row = 3, col = 4, i, j; @@ -49,7 +50,7 @@ title: 2025-2026学年春季期期中(whq) } ``` -2. ```c +2. ```c #include #define SQUARE(x) x*x int main() { @@ -62,8 +63,7 @@ title: 2025-2026学年春季期期中(whq) ## 四、手写代码(40 分) - -1. 求五个数中的中位数 +1. 求五个数中的中位数 **Input** @@ -73,7 +73,7 @@ title: 2025-2026学年春季期期中(whq) > `3` -2. 求 `100~999` 的素数水仙花数,如果没有,输出`No Such Number.` +2. 求 `100~999` 的素数水仙花数,如果没有,输出`No Such Number.` **Input** @@ -82,4 +82,3 @@ title: 2025-2026学年春季期期中(whq) **Output** > `No Such Number.` - From 5560f24b575b9cd14ac30c8ab0309b7cf32018f1 Mon Sep 17 00:00:00 2001 From: KirisameVanilla <118162831+kirisamevanilla@users.noreply.github.com> Date: Thu, 20 Nov 2025 23:41:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E8=80=83=E5=AF=9Fstatic=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E5=BD=93=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md index 2b9a8d9..1b90d63 100644 --- a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md +++ b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md @@ -23,18 +23,18 @@ title: 2025-2026学年春季期期中(张泉) } ``` -2. a=\_\_\_\_ +2. a=\_\_\_\_

a=\_\_\_\_ ```c #include void Anaesthesia(int b) { static int a = 0; a += b; + printf("a=%d\n", a); } int main() { Anaesthesia(5); Anaesthesia(5); - printf("a=%d", a); } ``` From 6e3d92de22eab5effcf565da133c895d9eab20d4 Mon Sep 17 00:00:00 2001 From: KirisameVanilla <118162831+kirisamevanilla@users.noreply.github.com> Date: Thu, 20 Nov 2025 23:43:43 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E7=BF=BB=E8=AF=91=E4=B8=BA=E4=BA=BA?= =?UTF-8?q?=E7=B1=BB=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md index 1b90d63..f572895 100644 --- a/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md +++ b/docs/undergraduate/软件工程学院/程序设计基础/2025-2026-1_期中_张泉.md @@ -7,7 +7,7 @@ title: 2025-2026学年春季期期中(张泉) 1. 变量定义可以数字开头 2. C 语言是面向过程的语言 3. `(x % 2 == 0) && (6 <= x <= 10)` 表示 $[6,10]$ 的偶数 -4. 逻辑顺序,代码紧凑,符合书写规范 +4. 不符合逻辑顺序的代码如果代码紧凑,则符合书写规范(大意如此) 5. 假定 `a, b` 是 `double` 类型。`printf("%lf", (a = 2, b = a + 3 / 2))` 输出是 `3.000000` ## 二、读代码(25 分)