From eacaddd6d75577bbab0109040242ced28f48837c Mon Sep 17 00:00:00 2001 From: "18218461270@163.com" <18218461270@163.com> Date: Fri, 1 Aug 2025 23:13:44 +0800 Subject: [PATCH] update chapter3 homework --- homework/chapter3/README.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/homework/chapter3/README.md b/homework/chapter3/README.md index 200068c..45ae3bf 100644 --- a/homework/chapter3/README.md +++ b/homework/chapter3/README.md @@ -1,37 +1,42 @@ ## 3.64 -A. $\&A[i][j][k]=x_A+L(i\cdot S\cdot T+j\cdot T+k)$; - -B. $R=7,S=5,T=13$。 +
    +
  1. $\&A[i][j][k]=x_A+L(i\cdot S\cdot T+j\cdot T+k)$;
  2. +
  3. $R=7,S=5,T=13$。
  4. +
## 3.68 由汇编第 2 行可知,$A\in(4,8]$;由第 3 行可知,$B\in(6,10]$;由第 4 行可知,$A\cdot B\in(44,46]$。因此,$A=5,B=9$。 ## 3.69 -A. 由汇编第 4 至 6 行可知,`a_struct` 大小为 40 字。再结合第 1 行可知 $CNT=7$; - -B. -由汇编第 6 至 8 行,`idx` 在 `x` 之前,类型均为 `long`(数组)。结合 `a_struct` 大小为 40 字,得到其声明如下: +
    +
  1. 由汇编第 4 至 6 行可知,`a_struct` 大小为 40 字。再结合第 1 行可知 $CNT=7$;
  2. +
  3. 由汇编第 6 至 8 行可知,`idx` 在 `x` 之前,类型均为 `long`(或 `long` 数组)。结合 `a_struct` 大小为 40 字,得到其声明如下: ```c typedef struct { long idx; long x[4]; } a_struct; ``` +
  4. +
+ ## 3.70 -A. +
    +
  1. | 字段 | 偏移量 | | --- | --- | | `e1.p` | 0 | | `e1.y` | 8 | | `e2.x` | 0 | | `e2.next` | 8 | - -B. 2 个 - -C. +
  2. +
  3. 2 个
  4. +
  5. ```c void proc (union ele *up) { up->e2.x = *(up->e2.next->e1.p) - (up->e2.next->e1.y); } ``` +
  6. +
\ No newline at end of file