Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 6b5ed15
Author: focused_xy <[email protected]>
Date:   Fri Oct 25 18:34:07 2024 +0800

    perf: 优化README

commit 115ebe7
Author: focused_xy <[email protected]>
Date:   Fri Oct 25 18:25:22 2024 +0800

    perf: 优化Lab4
    1. 将tower_move的声明移动到hanoi.c
    2. 修改了Makefile,将构建文件放入build,增加-MMD生成的头文件依赖
    3. 重命名native->naive以符合含意
    4. 删除函数的freopen重定向,改为命令行使用>重定向

commit ae6fd91
Author: wenjing233 <[email protected]>
Date:   Wed Oct 23 22:51:14 2024 +0800

    添加文本说明,完成代码挖空

commit baff4b5
Author: wenjing233 <[email protected]>
Date:   Wed Oct 23 21:31:14 2024 +0800

    保存工作

commit 11808b2
Author: wenjing233 <[email protected]>
Date:   Wed Oct 23 17:04:01 2024 +0800

    暂存工作进度

commit e0cc53c
Author: Zheng WenJing <[email protected]>
Date:   Tue Oct 22 23:17:45 2024 +0800

    feat: 完成solution和judge (#48)
  • Loading branch information
E1PsyCongroo committed Oct 25, 2024
1 parent b9bcaa1 commit 7e9f808
Show file tree
Hide file tree
Showing 30 changed files with 51 additions and 2,559 deletions.
Binary file added Labs/Solutions/Lab4-Sol.tar.gz
Binary file not shown.
11 changes: 10 additions & 1 deletion Labs/lab2/lab2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Lab2 C 语言基本语法

## Lab2_1 C 语言基本语法

- 完成lab2_1中的四个.c文件
- 请根据每个ex_中的TODO完成内容。
- 你可以使用 make 自动编译可执行文件

```bash
make # 编译所有可执行文件
make ex1_ptr # 仅编译 ex1_ptr.c
Expand All @@ -11,12 +14,16 @@
```

## Lab2_2 字符串和循环

- 本实验使用了参数char *argv[],请在编译后尝试向程序输入命令行参数,如:

```bash
make
./str_and_cyc California Oregon Washington Texas
```

输出内容,如下所示:

```bash
for:
arg 1: California
Expand All @@ -41,6 +48,7 @@
state 2: Washington
state 3: Texas
```

- 请对srt_and_cyc.c文件中的for和while循环尝试以下操作并查看结果。
- for循环
- 将i初始化为0看看会发生什么。是否也需要改动argc,不改动的话它能正常工作吗?为什么下标从0开始可以正常工作?
Expand All @@ -52,7 +60,6 @@
- 让这个复制循环不会执行失败,即使argv之中有很多元素也不会全部放进states。
- 研究你是否真正复制了这些字符串。答案可能会让你感到意外和困惑。


## 递归(可选,难度较大)

- 经典递归例子
Expand Down Expand Up @@ -96,6 +103,7 @@
- 实现一个递归函数`bool solveSudoku(int board[N][N], int row, int col)`判断数独是否可解,有解则填充正确答案。
- 题中数独采用二维数组,需解答填充的数字用0代替如:
```txt
0 6 0 0 0 0 0 7 1
7 0 5 4 0 3 0 0 0
Expand All @@ -107,6 +115,7 @@
0 7 9 0 0 0 5 0 2
0 0 0 0 0 4 7 0 0
```
- 使用`printBoard(int board[N][N])`函数打印数独
- 使用`isSafe(int board[N][N], int row, int col, int num)`函数检查数字是否可以放在board[row][col]位置。
- 运行judge.sh检测程序正确性。
Expand Down
29 changes: 0 additions & 29 deletions Labs/lab3/AnswerSheet.md

This file was deleted.

38 changes: 0 additions & 38 deletions Labs/lab3/Demo/.clang-format

This file was deleted.

31 changes: 0 additions & 31 deletions Labs/lab3/Demo/.eide/debug.files.options.yml

This file was deleted.

18 changes: 0 additions & 18 deletions Labs/lab3/Demo/.eide/debug.options.sdcc.json

This file was deleted.

43 changes: 0 additions & 43 deletions Labs/lab3/Demo/.eide/eide.json

This file was deleted.

49 changes: 0 additions & 49 deletions Labs/lab3/Demo/Demo.code-workspace

This file was deleted.

2 changes: 0 additions & 2 deletions Labs/lab3/Demo/README.md

This file was deleted.

Loading

0 comments on commit 7e9f808

Please sign in to comment.