From f5b37a17c9ad4e92fb603f19eea2794ee98ba309 Mon Sep 17 00:00:00 2001 From: Chiyo Yuki Date: Mon, 17 Nov 2025 19:34:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BD=AF=E4=BB=B6=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=AD=A6=E9=99=A2-=E7=A8=8B=E5=BA=8F=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=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.` +