--- 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.`