<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[KurisuRakko]]></title><description><![CDATA[A product-minded engineer building interfaces, workflows, and tiny autonomous systems.]]></description><link>https://rakko.cn</link><image><url>https://rakko.cn/favicon.ico</url><title>KurisuRakko</title><link>https://rakko.cn</link></image><generator>Yohaku (https://github.com/Innei/Yohaku)</generator><lastBuildDate>Tue, 02 Jun 2026 16:58:11 GMT</lastBuildDate><atom:link href="https://rakko.cn/feed" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Jun 2026 16:58:11 GMT</pubDate><language><![CDATA[zh-CN]]></language><item><title><![CDATA[COMP1511 焚诀主控台]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-start-here">https://rakko.cn/posts/comp1511/comp1511-start-here</a></blockquote><div><h1 id="comp1511-">COMP1511 焚诀主控台</h1><blockquote><p>非 UNSW 官方材料。本文只把 COMP1511 官方公开入口、revision 方向和本站第 1-10 课整理成“今天只做一步”的学习导航；不复制非公开考试题或登录后内容。<span>[S001][S028]</span><span>[S031][S032]</span><span>[S033][S034]</span><span>[S035][S036]</span></p></blockquote><blockquote>
<p>今天只做：回答 3 个问题，然后点 1 个入口。
下一步：做 1 道小题，写 1 条错因。
别乱跳：打开新页后不要再回来看目录，做完 checkbox 才回来。</p></blockquote>
<h2 id="">先回答三件事</h2><ul><li><input readOnly="" type="checkbox"/> 我现在准备：基础 / Exam 2 / Exam 3 / Final。</li><li><input readOnly="" type="checkbox"/> 我今天精力：10 分钟 / 25 分钟 / 50 分钟。</li><li><input readOnly="" type="checkbox"/> 我最怕：数组 / 字符串 / 指针 / linked list / debugging。</li></ul><h2 id="">现在只选一条路</h2><p>COMP1511 官方站点把内容放在 weekly materials、resources 和 revision 入口里；这里把它压成 4 条路线，避免你一次打开太多页面。[S001]</p><table><thead><tr><th> 你现在的状态 </th><th> 只点这个 </th><th> 今天做到什么算过 </th></tr></thead><tbody><tr><td> 基础虚 </td><td> <a href="/posts/comp1511/comp1511-exam1-start-here">Exam 1 路线图</a> </td><td> 能编译、能写循环、能碰数组 </td></tr><tr><td> 准备 Exam 2 </td><td> <a href="/posts/comp1511/comp1511-exam2-start-here">Exam 2 路线图</a> </td><td> string / 2D array / struct array 各看一次 </td></tr><tr><td> 准备 Exam 3 </td><td> <a href="/posts/comp1511/comp1511-exam3-start-here">Exam 3 路线图</a> </td><td> 画链表、写 traversal、记一个 <code>free</code> 错因 </td></tr><tr><td> 准备 Final </td><td> <a href="/posts/comp1511/comp1511-final-start-here">Final 路线图</a> </td><td> 先保 array，再保 linked list </td></tr></tbody></table><h2 id="10-">10 分钟版</h2><table><thead><tr><th> 分钟 </th><th> 做什么 </th></tr></thead><tbody><tr><td> 0-2 </td><td> 点上面 1 条路线 </td></tr><tr><td> 2-7 </td><td> 只看那页的第一个模板 </td></tr><tr><td> 7-10 </td><td> 写一条错因或口诀 </td></tr></tbody></table><h2 id="25-">25 分钟版</h2><ul><li><input readOnly="" type="checkbox"/> 5 分钟：看路线图第一屏。</li><li><input readOnly="" type="checkbox"/> 15 分钟：做 1 道最短练习。</li><li><input readOnly="" type="checkbox"/> 5 分钟：写错因三行。</li></ul><pre class="language-text lang-text"><code class="language-text lang-text">我错在：
下次先看：
同类题口诀：
</code></pre>
<h2 id="50-">50 分钟版</h2><ul><li><input readOnly="" type="checkbox"/> 10 分钟：复习模板。</li><li><input readOnly="" type="checkbox"/> 25 分钟：做 1 道公开练习方向题。</li><li><input readOnly="" type="checkbox"/> 10 分钟：对照错误类型修一次。</li><li><input readOnly="" type="checkbox"/> 5 分钟：写错因，不开新页面。</li></ul><details><summary>点开：我还是不知道点哪一个</summary><p>默认点你最近要考的那一场。没有最近考试，就点 Exam 2，因为 strings、2D arrays、structs 和 functions 会连接前半学期与后面的指针/链表内容。<span>[S013][S014]</span>[S015]</p></details><h2 id="">辅助工具</h2><ul><li><a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>：只在你已经知道阶段，但不知道做哪类题时打开。</li><li><a href="/posts/comp1511/comp1511-mistake-log-template">错题本模板</a>：只写三行，不写长篇复盘。</li><li><a href="/posts/comp1511/comp1511-study-plan-adhd">ADHD 学习计划</a>：注意力散了才打开，用来重启。</li></ul><h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S013] Lecture 7 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf</a></li><li>[S014] Lecture 8 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf</a></li><li>[S015] Lecture 9 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf</a></li><li>[S028] Additional exam-like questions: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/lab_exercises_like_the_exam.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/lab_exercises_like_the_exam.html</a></li><li>[S031] Week 04 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/04/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/04/questions</a></li><li>[S032] Week 05 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/05/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/05/questions</a></li><li>[S033] Week 06 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/06/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/06/questions</a></li><li>[S034] Week 07 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/07/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/07/questions</a></li><li>[S035] Week 08 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/08/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/08/questions</a></li><li>[S036] Week 10 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/10/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/10/questions</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-start-here#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-start-here</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-start-here</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Wed, 20 May 2026 13:55:45 GMT</pubDate></item><item><title><![CDATA[COMP1511 Week 1 Check-off 自救指南]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-week1-checkoff-guide">https://rakko.cn/posts/comp1511/comp1511-week1-checkoff-guide</a></blockquote><div><h1 id="comp1511-week-1-check-off-">COMP1511 Week 1 Check-off 自救指南</h1><blockquote><p>非 UNSW 官方材料。本文只按 COMP1511 26T1 官方公开页面做中文转述和学习路线整理；不包含真实 check-off 题目，也不替代 tutor 的说明。</p><p>今天只做一件事：把 VLab、terminal、第一段 C 程序、编译运行和提交流程跑通。你不需要现在就像高手，只需要能稳定完成 Week 1 的基本动作。</p></blockquote>
<h2 id="week-1-">Week 1 到底要干什么</h2><p>Week 1 的目标不是考你算法，而是让你熟悉 CSE 环境和最小的 C 编程流程。官方 lab 目标可以压成五件事：登录 CSE/VLab、熟悉 Linux terminal、用编辑器写小 C 程序、用 dcc 编译、在 terminal 运行程序。</p><p>你这周建议按这个顺序做：</p><ul><li>先看 Week 1 lecture / tutorial 的基础内容：Linux、terminal、C 程序结构、escape sequences。</li><li>然后完成 Lab 01 的 setup 部分：VLab、terminal、1511 setup、1511 colors。</li><li>再做 lab 练习：Bad Pun、ASCII Bird、修 Bunny、about_me。</li><li>最后在 scheduled lab session 里完成 check-off，让 tutor 验证。</li></ul><p>Problem Set 1 本身不计分，但官方页面明确说它是用来帮你完成 setup 和熟悉提交流程的；提交窗口到 Week 2 Monday 18:00。</p><h2 id="check-off-">Check-off 是什么，为什么不用怕</h2><p>Week 1 check-off 是 lab 里的现场验证活动，需要在 scheduled lab session 里完成，并由 tutor 或 lab assistant 给 access code / 验证。它的重点不是刁难你，而是确认你能在课程环境里做最基础的动作。</p><p>你提前练的时候，不要试图找真实题。真实题需要现场 access code，也不应该公开搬运。你要练的是这些动作：</p><ul><li>打开 VLab 和 terminal。</li><li>知道自己在哪个文件夹。</li><li>建一个 lab 文件夹。</li><li>写一个很小的 C 程序。</li><li>编译、运行、看输出。</li><li>如果报错，能读出“少了分号、引号、括号或 include”这种基础问题。</li></ul><p>如果 lab 当天卡住了，直接问 tutor。Week 1 页面也提醒：如果这些步骤卡住，不要憋着，tutor 就是来帮你把环境跑通的。</p><h2 id="-vlab--terminal-">先把 VLab 和 terminal 跑通</h2><p>进入 VLab 后，右键桌面打开 terminal。第一次用时先跑：</p><pre class="language-sh lang-sh"><code class="language-sh lang-sh">1511 setup
1511 colors
</code></pre>
<p>跑完后关闭 terminal 再重新打开。你只需要做一次。</p><p>接着记住这五个命令：</p><table><thead><tr><th> 命令 </th><th> 你要会说出它在干嘛 </th></tr></thead><tbody><tr><td> pwd </td><td> print working directory，显示当前所在文件夹 </td></tr><tr><td> ls </td><td> 列出当前文件夹里的文件 </td></tr><tr><td> cd </td><td> change directory，切换文件夹 </td></tr><tr><td> mkdir </td><td> 创建文件夹 </td></tr><tr><td> cp </td><td> 复制文件 </td></tr></tbody></table><p>最小练习如下：</p><pre class="language-sh lang-sh"><code class="language-sh lang-sh">pwd
ls
mkdir lab01
cd lab01
pwd
</code></pre>
<p>你看到路径最后是 lab01，就说明你站在正确位置了。</p><h2 id="-c-">第一段 C 程序只看骨架</h2><p>Week 1 的 C 程序先记这个骨架：</p><pre class="language-c lang-c"><code class="language-c lang-c">#include &lt;stdio.h&gt;

int main(void) {
    printf(&quot;Hello, COMP1511!\n&quot;);
    return 0;
}
</code></pre>
<p>你现在只需要理解：</p><ul><li>#include &lt;stdio.h&gt;：让你能用 printf。</li><li>int main(void)：程序从 main 开始跑。</li><li>printf：把文字打印到 terminal。</li><li>\n：换行。</li><li>return 0：程序正常结束。</li></ul><p>不要一开始就背复杂语法。Week 1 的安全感来自“我能写、能编译、能运行”。</p><h2 id="">编译和运行：固定两步</h2><p>假设文件叫 hello.c，先编译：</p><pre class="language-sh lang-sh"><code class="language-sh lang-sh">dcc hello.c -o hello
</code></pre>
<p>如果没有报错，再运行：</p><pre class="language-sh lang-sh"><code class="language-sh lang-sh">./hello
</code></pre>
<p>你最常见的卡点是把这两步混在一起。记住：dcc 负责把 C 文件变成可运行程序，./hello 才是运行。</p><h2 id="week-1-">Week 1 常见报错速查</h2><table><thead><tr><th> 你看到的现象 </th><th> 先检查什么 </th></tr></thead><tbody><tr><td> expected ; </td><td> 上一行末尾有没有少分号 </td></tr><tr><td> missing terminating &quot; character </td><td> printf 里的引号有没有成对 </td></tr><tr><td> implicit declaration of function printf </td><td> 有没有写 #include &lt;stdio.h&gt; </td></tr><tr><td> No such file or directory </td><td> 你是不是不在文件所在的文件夹；先 pwd 和 ls </td></tr><tr><td> Permission denied 或 command not found </td><td> 运行程序时是不是写了 ./program </td></tr></tbody></table><p>修 bug 的顺序：先看第一条报错，不要一次乱改十处。C 编译器经常因为一个漏掉的符号连环报错。</p><h2 id="autotest--give">autotest 和 give：先练流程</h2><p>每道练习通常会有 autotest 和 give。你要理解的是流程，不是背某一题的答案。</p><pre class="language-sh lang-sh"><code class="language-sh lang-sh">1511 autotest bad_pun
give cs1511 lab01_bad_pun bad_pun.c
</code></pre>
<p>具体 exercise 名称以 lab 页面显示为准。提交前至少确认三件事：</p><ul><li>文件名拼对。</li><li>dcc 编译能过。</li><li>程序输出和题目要求一致。</li></ul><h2 id="10--check-off-">10 分钟 check-off 练习</h2><p>不要看答案，自己计时做一遍：</p><ol start="1"><li>打开 terminal，进入 Desktop。</li><li>新建文件夹 week1_practice，然后 cd 进去。</li><li>写一个文件 me.c。</li><li>程序输出两行：第一行写你的名字，第二行写 I am ready for COMP1511。</li><li>用 dcc 编译成 me。</li><li>用 ./me 运行。</li><li>故意删掉一个分号，重新编译，看报错，再修回来。</li></ol><p>能独立做完这 7 步，Week 1 check-off 的恐惧感会降很多。</p><h2 id="lab-">Lab 当天清单</h2><ul><li>带上 zID / zPass。</li><li>提前打开 course page 和 Lab 01 页面。</li><li>不确定 access code 时问 tutor。</li><li>卡在环境问题超过 3 分钟就举手。</li><li>完成后确认 tutor 已经看到 / 记录。</li><li>回去后把 lab01 的练习也提交掉。</li></ul><h2 id="">官方来源</h2><ul><li><a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/">COMP1511 26T1 课程首页</a></li><li><a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/tut/01/questions">Week 01 Tutorial Activities</a></li><li><a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/lab/01/questions">Week 01 Laboratory Problem Set</a></li></ul><p>最后记住一句：Week 1 的目标是“会打开、会写、会编译、会运行、会求助”。不是一夜之间变成 C 语言高手。</p></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-week1-checkoff-guide#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-week1-checkoff-guide</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-week1-checkoff-guide</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 26 May 2026 16:10:12 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 5 课：strings、2D arrays 与 structs]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-05-2d-arrays-strings-structs">https://rakko.cn/posts/comp1511/comp1511-05-2d-arrays-strings-structs</a></blockquote><div><h1 id="-5-strings2d-arrays--structs">第 5 课：strings、2D arrays 与 structs</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 Week 04/05 的 strings、2D arrays、array of structs 与 command-line 相关 lecture slides 做中文转述；练习模板为本站原创。<span>[S013][S014]</span>[S015]</p></blockquote><blockquote>
<p>今天只做：string、2D array、struct array 各读一个最小模板。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-04-debugging-strings-exam-drill">上一课</a> · <a href="/posts/comp1511/comp1511-06-cli-multifile-pointers">下一课：命令行参数、多文件与指针入门</a>
别乱跳：2D array 永远先写 row，再写 col。</p></blockquote>
<h2 id="">本课目标</h2><p>今天只抓 3 件事：string 当 <code>char</code> array 读，2D array 先 row 再 col，struct array 先取出一个元素再看字段。<span>[S013][S014]</span>[S015]</p><table><thead><tr><th> 焚诀 </th><th> 先做什么 </th></tr></thead><tbody><tr><td> string </td><td> 一格一格看字符 </td></tr><tr><td> 2D array </td><td> 外层 <code>row</code>，内层 <code>col</code> </td></tr><tr><td> array of structs </td><td> <code>students[i].field</code> </td></tr></tbody></table><h2 id="">最小模板</h2><p>2D array 题不要先想图形，先写两层循环；这个写法对应官方 2D arrays 主题，但代码是原创练习模板。<span>[S014][S015]</span></p><pre class="language-c lang-c"><code class="language-c lang-c">int count_target(int grid[][NUM_COLS], int rows, int target) {
    int count = 0;

    for (int row = 0; row &lt; rows; row++) {
        for (int col = 0; col &lt; NUM_COLS; col++) {
            if (grid[row][col] == target) {
                count++;
            }
        }
    }

    return count;
}
</code></pre>
<h2 id="struct-array-">struct array 读法</h2><p>Lecture 7 提到 array of structs 的视觉理解；保命读法是：先定位 <code>i</code>，再读字段，不要同时脑补太多层。[S013]</p><pre class="language-c lang-c"><code class="language-c lang-c">struct student {
    int zid;
    int mark;
};

int count_passes(struct student students[], int size) {
    int passes = 0;

    for (int i = 0; i &lt; size; i++) {
        if (students[i].mark &gt;= 50) {
            passes++;
        }
    }

    return passes;
}
</code></pre>
<h2 id="5-">5 分钟练习</h2><ul><li><input readOnly="" type="checkbox"/> 写一个循环数出 string 里有几个 <code>&#x27;a&#x27;</code>。</li><li><input readOnly="" type="checkbox"/> 写一个 2D array 循环，把每一行的总和打印出来。</li><li><input readOnly="" type="checkbox"/> 写一个 struct array 循环，找最高 <code>mark</code>。</li></ul><details><summary>点开：最常见错因</summary><p>2D array 最常见错因是临时变量放错层级；每一行要重新计算的值，应该放在外层 <code>row</code> 循环里面。<span>[S014][S015]</span></p></details><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我知道 string 本质上可以按 <code>word[i]</code> 逐字符处理。</li><li><input readOnly="" type="checkbox"/> 我能写 <code>grid[row][col]</code>。</li><li><input readOnly="" type="checkbox"/> 我知道每一行的 <code>sum</code> 要在 row 循环里重置。</li><li><input readOnly="" type="checkbox"/> 我能读懂 <code>students[i].mark</code>。</li></ul><h2 id="">引用</h2><ul><li>[S013] Lecture 7 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf</a></li><li>[S014] Lecture 8 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf</a></li><li>[S015] Lecture 9 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-05-2d-arrays-strings-structs#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-05-2d-arrays-strings-structs</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-05-2d-arrays-strings-structs</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:16:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 6 课：命令行参数、多文件与指针入门]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-06-cli-multifile-pointers">https://rakko.cn/posts/comp1511/comp1511-06-cli-multifile-pointers</a></blockquote><div><h1 id="-6-">第 6 课：命令行参数、多文件与指针入门</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 Week 05 的 command line arguments、multi-file projects、pointers 和 memory lecture 做中文转述；代码模板为本站原创。<span>[S015][S016]</span></p></blockquote><blockquote>
<p>今天只做：分清 <code>argc</code>、<code>argv</code>、<code>&amp;</code>、<code>*</code> 四个符号。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-05-2d-arrays-strings-structs">上一课</a> · <a href="/posts/comp1511/comp1511-07-malloc-free-linked-list-start">下一课：malloc/free 与 linked list 起步</a>
别乱跳：指针先翻译成“地址”，不要马上想很深。</p></blockquote>
<h2 id="">本课目标</h2><p>第 6 课不追求“懂完内存”，只要先会读 3 个符号：<code>argc</code> 是数量，<code>argv</code> 是文字列表，<code>&amp;</code> 是地址。<span>[S015][S016]</span></p><table><thead><tr><th> 看见 </th><th> 先翻译成 </th></tr></thead><tbody><tr><td> <code>argc</code> </td><td> 参数个数 </td></tr><tr><td> <code>argv[1]</code> </td><td> 第一个额外参数 </td></tr><tr><td> <code>&amp;x</code> </td><td> <code>x</code> 的地址 </td></tr><tr><td> <code>*p</code> </td><td> 地址 <code>p</code> 指向的值 </td></tr></tbody></table><h2 id="command-line-arguments">command line arguments</h2><p>Lecture 9 进入 command line arguments；保命做法是先检查 <code>argc</code>，再读 <code>argv</code>，不要假设用户一定给了参数。[S015]</p><pre class="language-c lang-c"><code class="language-c lang-c">int main(int argc, char *argv[]) {
    if (argc &lt; 2) {
        printf(&quot;Usage: ./program word\n&quot;);
        return 1;
    }

    printf(&quot;first word: %s\n&quot;, argv[1]);
    return 0;
}
</code></pre>
<h2 id="">指针先别怕</h2><p>Lecture 10 把 pointers、memory 和 dynamic memory 放在一起；第一天只要记住“指针变量存的是地址”。[S016]</p><pre class="language-c lang-c"><code class="language-c lang-c">int value = 7;
int *pointer = &amp;value;

printf(&quot;%d\n&quot;, *pointer);
</code></pre>
<details><summary>点开：<code>*</code> 为什么有两个意思？</summary><p>在声明里，<code>int *pointer</code> 表示 <code>pointer</code> 是一个指向 <code>int</code> 的指针；在表达式里，<code>*pointer</code> 表示去这个地址里拿值。这个区分来自 C 指针语法，复习时要分场景看。<span>[S006][S016]</span></p></details><h2 id="5-">5 分钟练习</h2><ul><li><input readOnly="" type="checkbox"/> 写一个程序，没有参数时打印 usage。</li><li><input readOnly="" type="checkbox"/> 画出 <code>value -&gt; address -&gt; pointer</code>。</li><li><input readOnly="" type="checkbox"/> 解释 <code>&amp;value</code> 和 <code>*pointer</code> 的区别。</li></ul><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我会先检查 <code>argc</code>。</li><li><input readOnly="" type="checkbox"/> 我知道 <code>argv[0]</code> 通常是程序名。</li><li><input readOnly="" type="checkbox"/> 我知道指针保存地址。</li><li><input readOnly="" type="checkbox"/> 我不会在没检查的情况下直接读 <code>argv[1]</code>。</li></ul><h2 id="">引用</h2><ul><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S015] Lecture 9 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf</a></li><li>[S016] Lecture 10 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture10.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture10.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-06-cli-multifile-pointers#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-06-cli-multifile-pointers</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-06-cli-multifile-pointers</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:15:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 7 课：malloc/free 与 linked list 起步]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-07-malloc-free-linked-list-start">https://rakko.cn/posts/comp1511/comp1511-07-malloc-free-linked-list-start</a></blockquote><div><h1 id="-7-mallocfree--linked-list-">第 7 课：malloc/free 与 linked list 起步</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 Lecture 10/11 的 dynamic memory、malloc/free、multi-file projects 和 linked list 起步内容做中文转述；模板为本站原创。<span>[S016][S017]</span></p></blockquote><blockquote>
<p>今天只做：创建一个 node，再用 <code>curr</code> 走到 <code>NULL</code>。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-06-cli-multifile-pointers">上一课</a> · <a href="/posts/comp1511/comp1511-08-linked-list-delete">下一课：linked list 删除节点</a>
别乱跳：遍历时不要改 <code>head</code>，只移动 <code>curr</code>。</p></blockquote>
<h2 id="">本课目标</h2><p>今天只练一件事：一个 node 里面有数据和 <code>next</code>，很多 node 串起来就是 linked list。[S017]</p><table><thead><tr><th> 焚诀 </th><th> 意思 </th></tr></thead><tbody><tr><td> <code>malloc</code> </td><td> 申请一块空间 </td></tr><tr><td> <code>free</code> </td><td> 用完还回去 </td></tr><tr><td> <code>head</code> </td><td> 链表第一个节点 </td></tr><tr><td> <code>curr</code> </td><td> 正在看的节点 </td></tr></tbody></table><h2 id="">创建一个节点</h2><p>Lecture 11 把 malloc/free 和 linked list 放在一起讲；创建节点时先申请、再检查、再填字段。[S017]</p><pre class="language-c lang-c"><code class="language-c lang-c">struct node {
    int data;
    struct node *next;
};

struct node *create_node(int value) {
    struct node *new_node = malloc(sizeof(struct node));
    if (new_node == NULL) {
        return NULL;
    }

    new_node-&gt;data = value;
    new_node-&gt;next = NULL;
    return new_node;
}
</code></pre>
<h2 id="">遍历模板</h2><p>链表遍历对应 Lecture 11 的 traversal 主题；保命写法是 <code>curr != NULL</code>，每轮最后走到 <code>curr-&gt;next</code>。[S017]</p><pre class="language-c lang-c"><code class="language-c lang-c">void print_list(struct node *head) {
    struct node *curr = head;
    while (curr != NULL) {
        printf(&quot;%d\n&quot;, curr-&gt;data);
        curr = curr-&gt;next;
    }
}
</code></pre>
<details><summary>点开：为什么不要动 head？</summary><p><code>head</code> 是入口。如果你直接把 <code>head = head-&gt;next</code> 一路改下去，最后可能找不到原来的链表开头；用 <code>curr</code> 走路更稳。[S017]</p></details><h2 id="5-">5 分钟练习</h2><ul><li><input readOnly="" type="checkbox"/> 画 <code>head -&gt; [3] -&gt; [5] -&gt; NULL</code>。</li><li><input readOnly="" type="checkbox"/> 写 <code>print_list</code>。</li><li><input readOnly="" type="checkbox"/> 写一句话解释 <code>new_node-&gt;next = NULL</code>。</li></ul><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我知道 <code>malloc</code> 后要检查 <code>NULL</code>。</li><li><input readOnly="" type="checkbox"/> 我知道 linked list 的终点是 <code>NULL</code>。</li><li><input readOnly="" type="checkbox"/> 我能用 <code>curr</code> 遍历，不乱改 <code>head</code>。</li><li><input readOnly="" type="checkbox"/> 我知道用完动态内存要 <code>free</code>。</li></ul><h2 id="">引用</h2><ul><li>[S016] Lecture 10 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture10.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture10.pdf</a></li><li>[S017] Lecture 11 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_7/COMP1511_26T1_Lecture11.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_7/COMP1511_26T1_Lecture11.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-07-malloc-free-linked-list-start#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-07-malloc-free-linked-list-start</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-07-malloc-free-linked-list-start</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:14:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 8 课：linked list 删除节点]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-08-linked-list-delete">https://rakko.cn/posts/comp1511/comp1511-08-linked-list-delete</a></blockquote><div><h1 id="-8-linked-list-">第 8 课：linked list 删除节点</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 Lecture 13/14 的 linked list 删除节点内容做中文转述；不复刻考试题，代码模板为本站原创。<span>[S018][S019]</span></p></blockquote><blockquote>
<p>今天只做：画出删 head 和删 middle 的箭头变化。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-07-malloc-free-linked-list-start">上一课</a> · <a href="/posts/comp1511/comp1511-09-linked-list-exam-debugging">下一课：linked list 综合查错</a>
别乱跳：删除题先保 <code>prev</code> 和 <code>curr</code>，再考虑 <code>free</code>。</p></blockquote>
<h2 id="">本课目标</h2><p>删除节点不要分裂成一堆补丁；先统一想成“找到前一个节点，让它跳过要删的节点”。<span>[S018][S019]</span></p><table><thead><tr><th> 情况 </th><th> 先做什么 </th></tr></thead><tbody><tr><td> 空链表 </td><td> 直接返回 <code>head</code> </td></tr><tr><td> 删头 </td><td> 新 head 是旧 head 的 next </td></tr><tr><td> 删中间 </td><td> <code>prev-&gt;next = curr-&gt;next</code> </td></tr><tr><td> 删尾 </td><td> 同样是让 prev 指向 NULL </td></tr></tbody></table><h2 id="">删除第一个匹配值</h2><p>Lecture 13/14 的删除主题覆盖 head、tail、middle 和单节点；下面模板把这些情况放进同一条逻辑里。<span>[S018][S019]</span></p><pre class="language-c lang-c"><code class="language-c lang-c">struct node *delete_first(struct node *head, int value) {
    struct node *curr = head;
    struct node *prev = NULL;

    while (curr != NULL &amp;&amp; curr-&gt;data != value) {
        prev = curr;
        curr = curr-&gt;next;
    }

    if (curr == NULL) {
        return head;
    }

    if (prev == NULL) {
        head = curr-&gt;next;
    } else {
        prev-&gt;next = curr-&gt;next;
    }

    free(curr);
    return head;
}
</code></pre>
<h2 id="">口诀</h2><p>链表删除题先问 3 个问题：要删的是不是 <code>NULL</code>，要删的是不是 <code>head</code>，删完有没有把节点 <code>free</code>。<span>[S018][S019]</span></p><details><summary>点开：为什么函数要 return head？</summary><p>如果删的是第一个节点，<code>head</code> 会变；所以让函数返回新的 <code>head</code>，调用者才能接住变化。这是 linked list 删除题的保命接口习惯。<span>[S018][S019]</span></p></details><h2 id="5-">5 分钟练习</h2><ul><li><input readOnly="" type="checkbox"/> 画删除 head 的前后箭头。</li><li><input readOnly="" type="checkbox"/> 画删除 middle 的前后箭头。</li><li><input readOnly="" type="checkbox"/> 解释为什么 <code>free(curr)</code> 要在改好链接之后。</li></ul><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我知道空链表直接返回。</li><li><input readOnly="" type="checkbox"/> 我知道删头会改变 <code>head</code>。</li><li><input readOnly="" type="checkbox"/> 我知道删中间要保留 <code>prev</code>。</li><li><input readOnly="" type="checkbox"/> 我知道找不到目标时不应该乱 free。</li></ul><h2 id="">引用</h2><ul><li>[S018] Lecture 13 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_8/COMP1511_26T1_Lecture13.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_8/COMP1511_26T1_Lecture13.pdf</a></li><li>[S019] Lecture 13/14 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture1314.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture1314.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-08-linked-list-delete#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-08-linked-list-delete</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-08-linked-list-delete</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:13:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 9 课：linked list 综合与 exam-style debugging]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-09-linked-list-exam-debugging">https://rakko.cn/posts/comp1511/comp1511-09-linked-list-exam-debugging</a></blockquote><div><h1 id="-9-linked-list--exam-style-debugging">第 9 课：linked list 综合与 exam-style debugging</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 linked list 后续 lecture、Exam information lecture、Debugging Guide 和公开复习入口做中文转述；不复制真实考试题正文。<span>[S019][S020]</span><span>[S004][S001]</span></p></blockquote><blockquote>
<p>今天只做：写一个 linked list 长度函数，并测空链表。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-08-linked-list-delete">上一课</a> · <a href="/posts/comp1511/comp1511-10-final-revision">下一课：期末复习焚诀</a>
别乱跳：查错先测空、一个节点、三个节点。</p></blockquote>
<h2 id="">本课目标</h2><p>第 9 课把 linked list 题从“会写模板”推进到“能查错”；先保 traversal，再保 insert/delete，再看输出差异。<span>[S019][S020]</span>[S004]</p><table><thead><tr><th> 症状 </th><th> 先查 </th></tr></thead><tbody><tr><td> 崩溃 </td><td> <code>curr != NULL</code> 有没有守住 </td></tr><tr><td> 输出少一个 </td><td> 循环有没有提前停 </td></tr><tr><td> 删除后乱了 </td><td> <code>prev-&gt;next</code> 有没有接对 </td></tr><tr><td> 内存问题 </td><td> <code>malloc</code> / <code>free</code> 是否成对 </td></tr></tbody></table><h2 id="exam-style-">exam-style 查错顺序</h2><p>官方 Debugging Guide 把错误分成 compile、autotest、run time、logic；链表题也按这个顺序查，不要一上来重写整题。[S004]</p><ol start="1"><li>先让它编译。</li><li>再跑一个最小手动测试。</li><li>再跑公开允许的 autotest。</li><li>最后看边界：空链表、一个节点、删头、删尾、找不到。</li></ol><h2 id="">综合模板：数节点</h2><p>这题型常用来确认 traversal 是否安全；下面是原创模板，用来练 <code>curr != NULL</code> 的手感。[S019]</p><pre class="language-c lang-c"><code class="language-c lang-c">int list_length(struct node *head) {
    int length = 0;
    struct node *curr = head;

    while (curr != NULL) {
        length++;
        curr = curr-&gt;next;
    }

    return length;
}
</code></pre>
<details><summary>点开：最小测试怎么写？</summary><p>先测空链表长度是不是 0，再测一个节点是不是 1，最后测三个节点是不是 3；小测试能帮你定位 traversal 是不是提前断掉。<span>[S004][S019]</span></p></details><h2 id="5-">5 分钟练习</h2><ul><li><input readOnly="" type="checkbox"/> 写 <code>list_length</code>。</li><li><input readOnly="" type="checkbox"/> 给空链表、一个节点、三个节点各写一个预期。</li><li><input readOnly="" type="checkbox"/> 写一条错因：我这次错在 <code>curr</code>、<code>prev</code>、还是 <code>head</code>？</li></ul><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我能说出链表题先测哪三个边界。</li><li><input readOnly="" type="checkbox"/> 我能按 Debugging Guide 分类错误。</li><li><input readOnly="" type="checkbox"/> 我知道 autotest 失败时要看输出差异。</li><li><input readOnly="" type="checkbox"/> 我不会因为一题失败就整题重写。</li></ul><h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S019] Lecture 13/14 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture1314.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture1314.pdf</a></li><li>[S020] Lecture 15 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture15.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture15.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-09-linked-list-exam-debugging#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-09-linked-list-exam-debugging</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-09-linked-list-exam-debugging</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:12:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 10 课：期末复习焚诀]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-10-final-revision">https://rakko.cn/posts/comp1511/comp1511-10-final-revision</a></blockquote><div><h1 id="-10-">第 10 课：期末复习焚诀</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 Week 10、Exam revision 入口、Lecture 15/16 和 C reference sheet 做中文转述；prac exam 只给训练方向和链接，不复制题目正文。<span>[S001][S020]</span><span>[S021][S006]</span></p></blockquote><blockquote>
<p>今天只做：按 array、linked list、mixed 的顺序复习，不反过来。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-09-linked-list-exam-debugging">上一课</a> · <a href="/posts/comp1511/comp1511-final-start-here">Final 路线图</a>
别乱跳：先保 hurdle，再捡小题。</p></blockquote>
<h2 id="">本课目标</h2><p>期末不要贪全；先保 array hurdle，再保 linked list hurdle，最后用 mixed questions 捡分。<span>[S001][S020]</span>[S021]</p><table><thead><tr><th> 顺序 </th><th> 做什么 </th></tr></thead><tbody><tr><td> 1 </td><td> 数组和字符串基础 </td></tr><tr><td> 2 </td><td> linked list 遍历/插入/删除 </td></tr><tr><td> 3 </td><td> 指针和 malloc/free 错因 </td></tr><tr><td> 4 </td><td> mixed small questions </td></tr></tbody></table><h2 id="-10-">考前 10 分钟速查</h2><p>Lecture 15/16 进入 exam information、revision 和 exam-style questions；你的考前速查只保留会救命的模板。<span>[S020][S021]</span></p><ul><li><input readOnly="" type="checkbox"/> 数组：下标从 0 到 <code>size - 1</code>。</li><li><input readOnly="" type="checkbox"/> 2D array：外层 row，内层 col。</li><li><input readOnly="" type="checkbox"/> string：停在 <code>&#x27;\0&#x27;</code>。</li><li><input readOnly="" type="checkbox"/> pointer：<code>&amp;</code> 取地址，<code>*</code> 取地址里的值。</li><li><input readOnly="" type="checkbox"/> linked list：<code>curr != NULL</code> 才能读 <code>curr-&gt;data</code>。</li></ul><h2 id="">最小复习循环</h2><p>官方主页列出 Week 10 lab、prac exam solutions 和 exam revision 资源；本站只转成复习流程，不复制 prac exam 题目正文。[S001]</p><ol start="1"><li>15 分钟：做 1 道 array/string。</li><li>15 分钟：做 1 道 linked list traversal。</li><li>15 分钟：修 1 个错因。</li><li>5 分钟：写“下次先看什么”。</li></ol><details><summary>点开：今天只剩 30 分钟怎么办？</summary><p>只做 array hurdle 和 linked list traversal。期末复习最怕翻很多页但没有动手；先保能写出来的模板。<span>[S001][S020]</span></p></details><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我知道期末先保数组和链表。</li><li><input readOnly="" type="checkbox"/> 我能写一个安全的 linked list traversal。</li><li><input readOnly="" type="checkbox"/> 我能解释 <code>malloc</code> 后为什么要检查 <code>NULL</code>。</li><li><input readOnly="" type="checkbox"/> 我不会把 prac exam 内容复制到公开页面。</li></ul><h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S020] Lecture 15 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture15.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture15.pdf</a></li><li>[S021] Lecture 16 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_10/COMP1511_26T1_Lecture16.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_10/COMP1511_26T1_Lecture16.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-10-final-revision#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-10-final-revision</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-10-final-revision</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:11:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 Exam 2 急救路线图]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-exam2-start-here">https://rakko.cn/posts/comp1511/comp1511-exam2-start-here</a></blockquote><div><h1 id="comp1511-exam-2-">COMP1511 Exam 2 急救路线图</h1><blockquote><p>非 UNSW 官方材料。本文基于官方课程主页、strings/2D arrays 相关 lecture、Debugging Guide 和 Style Guide 做中文转述；不复制真实考试题正文。<span>[S001][S013]</span><span>[S014][S015]</span><span>[S004][S005]</span></p></blockquote><blockquote>
<p>今天只做：string、2D array、struct array 各过一遍。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-05-2d-arrays-strings-structs">第 5 课</a> · <a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>
别乱跳：第二次先保逐字符和 row/col。</p></blockquote>
<h2 id="">先把目标缩小</h2><p>Exam 2 先按 strings、2D arrays、structs、functions、assignment-style debugging 来准备；这和本站 AGENTS 规则一致，也贴合官方 Week 04/05 内容走向。<span>[S013][S014]</span>[S015]</p><table><thead><tr><th> 优先级 </th><th> 练什么 </th><th> 过关线 </th></tr></thead><tbody><tr><td> 1 </td><td> string 逐字符 </td><td> 能停在 <code>&#x27;\0&#x27;</code> </td></tr><tr><td> 2 </td><td> 2D array </td><td> 能 row/col 双循环 </td></tr><tr><td> 3 </td><td> struct array </td><td> 能读 <code>items[i].field</code> </td></tr><tr><td> 4 </td><td> debugging </td><td> 能分清错误类型 </td></tr></tbody></table><h2 id="-3-">今日 3 轮</h2><p>每轮 25 分钟，只做一件事。不要同时开 lecture、lab、答案和聊天窗口。[S001]</p><ol start="1"><li>看第 5 课。</li><li>做 1 道 string 或 2D array 题。</li><li>写 1 条错因。</li></ol><h2 id="">考前速查</h2><p>官方 Debugging Guide 建议先分类错误；Exam 2 也按 compile、autotest、run time、logic 的顺序查。[S004]</p><ul><li><input readOnly="" type="checkbox"/> 编译不过：看第一条错误。</li><li><input readOnly="" type="checkbox"/> 输出不对：看空格、换行、大小写。</li><li><input readOnly="" type="checkbox"/> 2D array 错：检查 row/col 有没有写反。</li><li><input readOnly="" type="checkbox"/> string 错：检查有没有越过 <code>&#x27;\0&#x27;</code>。</li></ul><details><summary>点开：我很慌时只做什么？</summary><p>只做 2D array 模板和 string 模板。先拿会循环的分，再慢慢补 struct 和函数限制。<span>[S014][S015]</span></p></details><h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S005] COMP1511 Style Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html</a></li><li>[S013] Lecture 7 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf</a></li><li>[S014] Lecture 8 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf</a></li><li>[S015] Lecture 9 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-exam2-start-here#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-exam2-start-here</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-exam2-start-here</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:10:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 Exam 3 急救路线图]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-exam3-start-here">https://rakko.cn/posts/comp1511/comp1511-exam3-start-here</a></blockquote><div><h1 id="comp1511-exam-3-">COMP1511 Exam 3 急救路线图</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 pointers、malloc/free、linked list 和 debugging 相关公开资料做中文转述；不复制真实考试题正文。<span>[S016][S017]</span><span>[S018][S019]</span>[S004]</p></blockquote><blockquote>
<p>今天只做：画链表，写 traversal，再写一条 <code>head/curr/prev/free</code> 错因。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-07-malloc-free-linked-list-start">第 7 课</a> · <a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>
别乱跳：第三次先保 traversal，再保删除。</p></blockquote>
<h2 id="">先把目标缩小</h2><p>Exam 3 先保 pointers、malloc/free、linked list 遍历、插入和删除；这些主题集中出现在 Lecture 10 到 Lecture 13/14。<span>[S016][S017]</span><span>[S018][S019]</span></p><table><thead><tr><th> 优先级 </th><th> 练什么 </th><th> 过关线 </th></tr></thead><tbody><tr><td> 1 </td><td> 指针读法 </td><td> 分清 <code>&amp;</code> 和 <code>*</code> </td></tr><tr><td> 2 </td><td> malloc/free </td><td> 申请、检查、释放 </td></tr><tr><td> 3 </td><td> traversal </td><td> <code>curr != NULL</code> </td></tr><tr><td> 4 </td><td> delete </td><td> 能处理删头 </td></tr></tbody></table><h2 id="-3-">今日 3 轮</h2><ul><li><input readOnly="" type="checkbox"/> 画 1 条链表。</li><li><input readOnly="" type="checkbox"/> 写 1 个 traversal。</li><li><input readOnly="" type="checkbox"/> 写 1 条错因：我错在 <code>head</code>、<code>curr</code>、<code>prev</code>、还是 <code>free</code>？</li></ul><h2 id="">最小模板</h2><p>linked list 题先写 traversal；插入删除都是在这个安全移动基础上加逻辑。<span>[S017][S018]</span>[S019]</p><pre class="language-c lang-c"><code class="language-c lang-c">struct node *curr = head;
while (curr != NULL) {
    curr = curr-&gt;next;
}
</code></pre>
<details><summary>点开：先别做什么？</summary><p>先别背大段答案。链表题真正保命的是画图、保护 <code>head</code>、检查 <code>NULL</code>、最后再 <code>free</code>。<span>[S017][S018]</span>[S019]</p></details><h2 id="">引用</h2><ul><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S016] Lecture 10 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture10.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture10.pdf</a></li><li>[S017] Lecture 11 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_7/COMP1511_26T1_Lecture11.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_7/COMP1511_26T1_Lecture11.pdf</a></li><li>[S018] Lecture 13 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_8/COMP1511_26T1_Lecture13.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_8/COMP1511_26T1_Lecture13.pdf</a></li><li>[S019] Lecture 13/14 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture1314.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture1314.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-exam3-start-here#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-exam3-start-here</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-exam3-start-here</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:09:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 Final 急救路线图]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-final-start-here">https://rakko.cn/posts/comp1511/comp1511-final-start-here</a></blockquote><div><h1 id="comp1511-final-">COMP1511 Final 急救路线图</h1><blockquote><p>非 UNSW 官方材料。本文基于官方课程主页、Exam information/revision lectures、C reference sheet 和公开 revision 入口做中文转述；不复制 prac exam 题目正文。<span>[S001][S020]</span><span>[S021][S006]</span></p></blockquote><blockquote>
<p>今天只做：先 array hurdle，再 linked list hurdle，最后 mixed。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-10-final-revision">第 10 课</a> · <a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>
别乱跳：期末不要从最难大题开始。</p></blockquote>
<h2 id="">先把目标缩小</h2><p>Final 先保 array hurdle，再保 linked list hurdle，最后做 mixed small questions；官网 Week 10 和 Important Resources 区域提供 revision/prac exam 入口。<span>[S001][S020]</span>[S021]</p><table><thead><tr><th> 顺序 </th><th> 今天做 </th><th> 做到什么算过 </th></tr></thead><tbody><tr><td> 1 </td><td> array/string </td><td> 能安全循环 </td></tr><tr><td> 2 </td><td> linked list </td><td> 能 traversal + delete head </td></tr><tr><td> 3 </td><td> pointer/malloc </td><td> 能解释地址和释放 </td></tr><tr><td> 4 </td><td> mixed </td><td> 限时做，不恋战 </td></tr></tbody></table><h2 id="50-">50 分钟急救版</h2><ol start="1"><li>10 分钟：看第 10 课速查。</li><li>15 分钟：做 1 道 array/string。</li><li>15 分钟：做 1 道 linked list。</li><li>10 分钟：写错因和下一题入口。</li></ol><h2 id="">不要踩的坑</h2><ul><li><input readOnly="" type="checkbox"/> 不要把 <code>autotest</code> 当作 <code>submit</code>。</li><li><input readOnly="" type="checkbox"/> 不要在公开页面复制真实考试题正文。</li><li><input readOnly="" type="checkbox"/> 不要用题目禁止的库函数或语言特性。</li><li><input readOnly="" type="checkbox"/> 不要在链表题里乱改 <code>head</code>。</li></ul><details><summary>点开：只剩一天怎么办？</summary><p>只跑 array/string + linked list 两条线。Final 复习不是把所有内容看一遍，而是让手能写出保命模板。<span>[S001][S020]</span>[S021]</p></details><h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S020] Lecture 15 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture15.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_9/COMP1511_26T1_Lecture15.pdf</a></li><li>[S021] Lecture 16 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_10/COMP1511_26T1_Lecture16.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_10/COMP1511_26T1_Lecture16.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-final-start-here#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-final-start-here</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-final-start-here</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:08:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 ADHD 友好学习计划]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-study-plan-adhd">https://rakko.cn/posts/comp1511/comp1511-study-plan-adhd</a></blockquote><div><h1 id="comp1511-adhd-">COMP1511 ADHD 友好学习计划</h1><blockquote><p>非 UNSW 官方材料。本文把官方 Week-by-Week 内容、revision 入口和本站第 1-10 课压成短块学习计划；不复制题目正文。[S001]</p></blockquote><blockquote>
<p>今天只做：看一页、做一题、写一条错因。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>
别乱跳：注意力散了就回到 10 分钟版。</p></blockquote>
<h2 id="">焚诀总纲</h2><p>每天只做 3 轮，每轮只做 1 件事：看一页、做一题、写一条错因。COMP1511 官网内容很多，所以这里用短块入口防止你被页面数量淹没。[S001]</p><table><thead><tr><th> 轮次 </th><th> 时间 </th><th> 任务 </th></tr></thead><tbody><tr><td> 1 </td><td> 25 分钟 </td><td> 看 1 页焚诀 </td></tr><tr><td> 2 </td><td> 25 分钟 </td><td> 做 1 题 </td></tr><tr><td> 3 </td><td> 15 分钟 </td><td> 写 1 条错因 </td></tr></tbody></table><h2 id="">今天怎么选</h2><table><thead><tr><th> 状态 </th><th> 点哪页 </th></tr></thead><tbody><tr><td> 基础虚 </td><td> Exam 1 + 第 1-4 课 </td></tr><tr><td> 第二次 </td><td> Exam 2 + 第 5 课 </td></tr><tr><td> 第三次 </td><td> Exam 3 + 第 6-9 课 </td></tr><tr><td> 期末 </td><td> Final + 第 10 课 </td></tr></tbody></table><h2 id="">错因模板</h2><pre class="language-text lang-text"><code class="language-text lang-text">我错在：
下次先看：
同类题口诀：
</code></pre>
<details><summary>点开：注意力散了怎么办？</summary><p>只做下一颗豆子：打开一页、复制一个模板、跑一个最小测试。不要补计划，不要换工具，不要开新页面。[S001]</p></details><h2 id="">每周保命线</h2><ul><li><input readOnly="" type="checkbox"/> 第 1-4 课：能编译、能循环、能数组。</li><li><input readOnly="" type="checkbox"/> 第 5 课：能 string / 2D array / struct array。</li><li><input readOnly="" type="checkbox"/> 第 6 课：能读 <code>argc</code>、<code>argv</code>、<code>&amp;</code>、<code>*</code>。</li><li><input readOnly="" type="checkbox"/> 第 7-9 课：能 linked list traversal / insert / delete。</li><li><input readOnly="" type="checkbox"/> 第 10 课：能按 Final 顺序限时复习。</li></ul><h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-study-plan-adhd#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-study-plan-adhd</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-study-plan-adhd</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:07:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 练习菜单]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-practice-menu">https://rakko.cn/posts/comp1511/comp1511-practice-menu</a></blockquote><div><h1 id="comp1511-">COMP1511 练习菜单</h1><blockquote><p>非 UNSW 官方材料。本文只整理训练方向和官方公开入口，不复制 revision/prac exam 题目正文。<span>[S001][S031]</span><span>[S032][S033]</span><span>[S034][S035]</span>[S036]</p></blockquote><blockquote>
<p>今天只做：只挑 1 个练习方向，不挑一整套。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-mistake-log-template">错题本模板</a>
别乱跳：选完题就离开菜单，别继续逛。</p></blockquote>
<h2 id="">今天只挑一题</h2><p>COMP1511 官网按 week、revision、resources 组织了大量公开练习入口；这里把它压成“每天只挑一题”的菜单，防止你在页面之间乱跳。[S001]</p><table><thead><tr><th> 状态 </th><th> 今天只做 </th></tr></thead><tbody><tr><td> 第二次 </td><td> string / 2D array / struct array </td></tr><tr><td> 第三次 </td><td> pointer / malloc / linked list traversal </td></tr><tr><td> 期末 </td><td> array hurdle / linked list hurdle </td></tr></tbody></table><h2 id="exam-2-">Exam 2 菜单</h2><p>Exam 2 先练 strings、2D arrays、structs 和 debugging；Week 04/05 extra revision 可作为公开练习入口。<span>[S031][S032]</span></p><ul><li><input readOnly="" type="checkbox"/> 逐字符扫描一个 string。</li><li><input readOnly="" type="checkbox"/> 用 row/col 走完一个 2D array。</li><li><input readOnly="" type="checkbox"/> 从 struct array 里找最大值。</li><li><input readOnly="" type="checkbox"/> 按 Debugging Guide 写出错误类型。[S004]</li></ul><h2 id="exam-3-">Exam 3 菜单</h2><p>Exam 3 先练 pointers、malloc/free 和 linked list；Week 06/07/08 extra revision 可作为公开练习入口。<span>[S033][S034]</span>[S035]</p><ul><li><input readOnly="" type="checkbox"/> 画出 <code>int *p = &amp;x</code>。</li><li><input readOnly="" type="checkbox"/> 写一个 <code>create_node</code>。</li><li><input readOnly="" type="checkbox"/> 写一个 linked list traversal。</li><li><input readOnly="" type="checkbox"/> 写一个 delete-head 分支。</li></ul><h2 id="final-">Final 菜单</h2><p>Final 先从 Week 10 revision、exam-style resources 和 C reference sheet 回到保命模板；这里只留训练方向，不复制 prac exam 内容。<span>[S006][S028]</span><span>[S029][S036]</span></p><ul><li><input readOnly="" type="checkbox"/> 15 分钟 array/string。</li><li><input readOnly="" type="checkbox"/> 15 分钟 linked list。</li><li><input readOnly="" type="checkbox"/> 10 分钟 pointer/malloc 错因。</li><li><input readOnly="" type="checkbox"/> 10 分钟 mixed question。</li></ul><details><summary>点开：不会选题怎么办？</summary><p>选你最怕但最短的那一类。不要选“大综合”，先选 string 计数、2D array 求和、linked list 长度这种能 25 分钟结束的题。<span>[S001][S004]</span></p></details><h2 id="">做完写这三行</h2><pre class="language-text lang-text"><code class="language-text lang-text">我错在：
下次先看：
同类题口诀：
</code></pre>
<h2 id="">引用</h2><ul><li>[S001] COMP1511 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S028] Additional exam-like questions: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/lab_exercises_like_the_exam.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/lab_exercises_like_the_exam.html</a></li><li>[S029] Prac Exam Solutions: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/prac-exam-solns.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/prac-exam-solns.html</a></li><li>[S031] Week 04 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/04/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/04/questions</a></li><li>[S032] Week 05 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/05/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/05/questions</a></li><li>[S033] Week 06 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/06/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/06/questions</a></li><li>[S034] Week 07 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/07/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/07/questions</a></li><li>[S035] Week 08 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/08/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/08/questions</a></li><li>[S036] Week 10 extra revision: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/10/questions">https://cgi.cse.unsw.edu.au/~cs1511/26T1/revision/10/questions</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-practice-menu#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-practice-menu</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-practice-menu</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:06:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 错题本模板]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-mistake-log-template">https://rakko.cn/posts/comp1511/comp1511-mistake-log-template</a></blockquote><div><h1 id="comp1511-">COMP1511 错题本模板</h1><blockquote><p>非 UNSW 官方材料。本文基于 Debugging Guide、Style Guide 和本站学习流程整理错题记录格式；不复制题目正文。<span>[S004][S005]</span></p></blockquote><blockquote>
<p>今天只做：错题只写三行。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>
别乱跳：复盘超过 3 分钟就停。</p></blockquote>
<h2 id="">只写三行</h2><p>Debugging Guide 先把错误分成 compile、autotest、run time、logic；错题本也只记录这三行，不写长篇复盘。[S004]</p><pre class="language-text lang-text"><code class="language-text lang-text">我错在：
下次先看：
同类题口诀：
</code></pre>
<h2 id="">错因分类</h2><table><thead><tr><th> 错因 </th><th> 例子 </th></tr></thead><tbody><tr><td> 编译 </td><td> 少分号、函数签名不对 </td></tr><tr><td> 输出 </td><td> 空格、换行、大小写不匹配 </td></tr><tr><td> 边界 </td><td> 空数组、空链表、一个节点 </td></tr><tr><td> 逻辑 </td><td> 循环条件、初始化位置、return 值 </td></tr></tbody></table><h2 id="">例子</h2><p>下面是格式示例，不是官方题目答案。<span>[S004][S005]</span></p><pre class="language-text lang-text"><code class="language-text lang-text">我错在：把 sum 放在 row 循环外面，导致每一行没有重新计数。
下次先看：临时变量应该在哪一层初始化。
同类题口诀：每行重置，外 row 内 col。
</code></pre>
<details><summary>点开：写太多怎么办？</summary><p>删到三行。错题本不是日记，它的目标是让下一次做题时更快发现同类错误。[S004]</p></details><h2 id="">今天过关</h2><ul><li><input readOnly="" type="checkbox"/> 我只记录 1 道错题。</li><li><input readOnly="" type="checkbox"/> 我写了错误类型。</li><li><input readOnly="" type="checkbox"/> 我写了下次先看什么。</li><li><input readOnly="" type="checkbox"/> 我写了一个短口诀。</li></ul><h2 id="">引用</h2><ul><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S005] COMP1511 Style Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-mistake-log-template#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-mistake-log-template</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-mistake-log-template</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Tue, 19 May 2026 13:05:40 GMT</pubDate></item><item><title><![CDATA[COMP1511 Exam 1 急救路线图]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-exam1-start-here">https://rakko.cn/posts/comp1511/comp1511-exam1-start-here</a></blockquote><div><h1 id="comp1511-exam-1-">COMP1511 Exam 1 急救路线图</h1><blockquote><p>非 UNSW 官方材料。这是百夜米迦尔基于 COMP1511 26T1 官方公开页面、Lab Exam 信息页和 lecture slides 写的中文转述学习笔记，不复制题目正文、不托管 PDF/PPT、不替代官方说明。<span>[S001][S002]</span>[S003]</p></blockquote><blockquote>
<p>今天只做：基础虚就按第 1-4 课顺序补，不开其他路线。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-01-terminal-hello-c">第 1 课</a> · <a href="/posts/comp1511/comp1511-practice-menu">练习菜单</a>
别乱跳：Exam 1 只保编译、循环、数组、debugging。</p></blockquote>
<h2 id="">先把目标缩小</h2><p>课程首页把内容按 week、lecture、tutorial、lab、revision 和 resources 组织；Lab Exam 信息页公开说明了示例考试的时间、题量、分值结构和保密要求，所以今晚的目标不是“把整门课完整补完”，而是按 Exam 1 最高收益主题补齐输入输出、条件、循环、函数、数组、字符串和 debugging。<span>[S001][S003]</span></p><table><thead><tr><th> 优先级 </th><th> 今晚主题 </th><th> 你要做到 </th></tr></thead><tbody><tr><td> 1 </td><td> 1D / 2D array </td><td> 能用下标循环、计数、找位置、返回结果 </td></tr><tr><td> 2 </td><td> 输入输出 </td><td> 能写 <code>printf</code> / <code>scanf</code>，并让格式完全匹配 </td></tr><tr><td> 3 </td><td> 条件和循环 </td><td> 能把题目条件翻译成 <code>if/else</code>、<code>while</code>、<code>for</code> </td></tr><tr><td> 4 </td><td> debugging / string </td><td> 能定位编译错误、autotest 差异和字符串结束条件 </td></tr></tbody></table><h2 id="">官方来源告诉我们的复习顺序</h2><p>Lecture 1/2 覆盖 C 程序、终端、变量和基础输入输出；Lecture 3/4 进入条件与循环；Lecture 5/6 开始强调函数、style 和数组；Lecture 7/8/9 继续展开字符串与二维数组。这个顺序很适合做“从第一节课开始，但只抓 Exam 1 相关动作”的急救路径。<span>[S007][S008]</span><span>[S009][S010]</span><span>[S011][S012]</span><span>[S013][S014]</span>[S015]</p><p>Debugging Guide 把错误分成编译错误、autotest 错误、运行时错误和逻辑错误；这正好对应考前最后一轮检查：先让代码能编译，再看输出差异，最后处理边界和逻辑。[S004]</p><details><summary>点开：如果只剩 90 分钟，怎么救？</summary><ol start="1"><li>25 分钟：写 3 个最小程序，分别练 <code>printf</code>、<code>scanf</code>、<code>if/else</code>。<span>[S006][S008]</span>[S009]</li><li>35 分钟：只练数组模板，先 1D，再 2D；数组是 lecture 中从 Week 3/4 开始反复出现的核心材料。<span>[S012][S013]</span><span>[S014][S015]</span></li><li>20 分钟：按 Debugging Guide 的分类查错，不要在一条报错里硬猜。[S004]</li><li>10 分钟：读 Lab Exam 信息页的时间、autotest、fetch 和保密要求，只看规则，不复制题目内容。[S003]</li></ol></details><h2 id="">今天别做这些</h2><ul><li>不要把 UNSW PDF 或 PPT 复制到自己站上；这里所有学习页只链接官方来源并做中文转述。[S002]</li><li>不要复刻 Lab Exam 题目、样例数组、样例输出或题目提供的初始文件；只引用公开规则和高层结构。[S003]</li><li>不要用没讲过的花哨 C 特性救场；Style Guide 建议初学者优先使用 lecture 中已经覆盖的语言特性。[S005]</li></ul><h2 id="">过关勾选</h2><ul><li><input readOnly="" type="checkbox"/> 我能编译并运行一个最小 C 程序。</li><li><input readOnly="" type="checkbox"/> 我能写 <code>if/else</code> 和至少一种循环。</li><li><input readOnly="" type="checkbox"/> 我能用下标访问 1D / 2D array。</li><li><input readOnly="" type="checkbox"/> 我能按 Debugging Guide 先分清错误类型。[S004]</li></ul><h2 id="">本系列链接</h2><ul><li>当前：路线图</li><li><a href="/posts/comp1511/comp1511-01-terminal-hello-c">第 1 课：终端、main 与第一段 C 程序</a></li><li><a href="/posts/comp1511/comp1511-02-variables-input-branching">第 2 课：变量、scanf 与 if/else</a></li><li><a href="/posts/comp1511/comp1511-03-loops-functions-arrays">第 3 课：循环、函数与数组</a></li><li><a href="/posts/comp1511/comp1511-04-debugging-strings-exam-drill">第 4 课：debugging、字符串与模拟考试</a></li></ul><h2 id="">引用</h2><ul><li>[S001] COMP1511 26T1 course homepage: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/">https://cgi.cse.unsw.edu.au/~cs1511/current/</a></li><li>[S002] COMP1511 lecture slides index: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/</a></li><li>[S003] COMP1511 Lab Exam public information page: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/labexam/index.html">https://cgi.cse.unsw.edu.au/~cs1511/current/labexam/index.html</a></li><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S005] COMP1511 Style Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S007] Lecture 1 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_1/COMP1511_26T1_Lecture01.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_1/COMP1511_26T1_Lecture01.pdf</a></li><li>[S008] Lecture 2 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_1/COMP1511_26T1_Lecture02.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_1/COMP1511_26T1_Lecture02.pdf</a></li><li>[S009] Lecture 3 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture03.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture03.pdf</a></li><li>[S010] Lecture 4 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture04.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture04.pdf</a></li><li>[S011] Lecture 5 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture05.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture05.pdf</a></li><li>[S012] Lecture 6 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture06.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture06.pdf</a></li><li>[S013] Lecture 7 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf</a></li><li>[S014] Lecture 8 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf</a></li><li>[S015] Lecture 9 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-exam1-start-here#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-exam1-start-here</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-exam1-start-here</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Mon, 18 May 2026 15:29:00 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 2 课：变量、scanf 与 if/else]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-02-variables-input-branching">https://rakko.cn/posts/comp1511/comp1511-02-variables-input-branching</a></blockquote><div><h1 id="-2-scanf--ifelse">第 2 课：变量、scanf 与 if/else</h1><blockquote><p>非 UNSW 官方材料。本文按官方 Lecture 2/3/4 和 C reference sheet 转述变量、输入输出和条件控制；练习题为原创。<span>[S008][S009]</span><span>[S010][S006]</span></p></blockquote><blockquote>
<p>今天只做：把 <code>int</code>、<code>double</code>、<code>char</code> 和 <code>scanf</code> 占位符配对。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-01-terminal-hello-c">上一课</a> · <a href="/posts/comp1511/comp1511-03-loops-functions-arrays">下一课：循环、函数与数组</a>
别乱跳：输入题先把格式读对，再写漂亮分支。</p></blockquote>
<h2 id="">变量：先说类型，再放值</h2><p>Lecture 2 明确把 variables、constants 和 C 里的 maths 放在早期主题；你现在要先能识别 <code>int</code>、<code>double</code>、<code>char</code>，再配对 <code>printf</code> / <code>scanf</code> 的格式占位符。<span>[S008][S006]</span></p><pre class="language-c lang-c"><code class="language-c lang-c">int age = 18;
double mark = 72.5;
char grade = &#x27;C&#x27;;
</code></pre>
<table><thead><tr><th> 类型 </th><th> 常见用途 </th><th> 输出占位符 </th></tr></thead><tbody><tr><td> <code>int</code> </td><td> 整数 </td><td> <code>%d</code> </td></tr><tr><td> <code>double</code> </td><td> 小数 </td><td> <code>%lf</code> </td></tr><tr><td> <code>char</code> </td><td> 单个字符 </td><td> <code>%c</code> </td></tr></tbody></table><h2 id="scanf">scanf：先练对普通变量</h2><p>Lecture 3 回顾了 <code>printf()</code> / <code>scanf()</code>，Lecture 4 继续把 <code>scanf</code> 错误和控制流放在一起；考前先记住普通变量读入时要把地址传给 <code>scanf</code>。<span>[S009][S010]</span></p><pre class="language-c lang-c"><code class="language-c lang-c">int x;
scanf(&quot;%d&quot;, &amp;x);

char ch;
scanf(&quot; %c&quot;, &amp;ch);
</code></pre>
<p><code>%c</code> 前面的空格是为了跳过前面残留的空白字符；这条是考前很实用的经验解释，来源背景是官方 debugging 和 lecture 对输入错误的反复强调。<span>[S004][S010]</span></p><details><summary>点开：为什么 int 要写 &amp;x？</summary><p><code>scanf</code> 要把读到的值写回变量，所以它需要变量的位置；对普通 <code>int</code>、<code>double</code>、<code>char</code> 变量，先按 <code>&amp;变量名</code> 的模式写。后面学数组和字符串时会有例外。[S006]</p></details><h2 id="ifelse">if/else：把条件翻译成分支</h2><p>Lecture 3 把 <code>if</code> statements、logical operators、<code>else</code> 和循环放在 control flow 主题里；写分支时先按中文题意拆成互斥区间，再写代码。[S009]</p><pre class="language-c lang-c"><code class="language-c lang-c">if (mark &lt; 50) {
    printf(&quot;fail\n&quot;);
} else if (mark &lt; 65) {
    printf(&quot;pass\n&quot;);
} else {
    printf(&quot;higher\n&quot;);
}
</code></pre>
<p>这里第二个分支不用再写 <code>mark &gt;= 50</code>，因为第一段已经排除了更小的情况。这是原创讲法，用来训练“前面的条件会影响后面的条件”。[S009]</p><h2 id="">立刻练</h2><p>写一个程序读入整数 <code>temperature</code>：小于 18 输出 <code>cold</code>，18 到 27 输出 <code>ok</code>，大于 27 输出 <code>hot</code>。这道题是原创，不使用官方 Lab Exam 题目或样例。[S003]</p><details><summary>参考答案</summary><pre class="language-c lang-c"><code class="language-c lang-c">#include &lt;stdio.h&gt;

int main(void) {
    int temperature;
    scanf(&quot;%d&quot;, &amp;temperature);

    if (temperature &lt; 18) {
        printf(&quot;cold\n&quot;);
    } else if (temperature &lt;= 27) {
        printf(&quot;ok\n&quot;);
    } else {
        printf(&quot;hot\n&quot;);
    }

    return 0;
}
</code></pre></details><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我能把 <code>int</code>、<code>double</code>、<code>char</code> 和格式占位符配上。</li><li><input readOnly="" type="checkbox"/> 我知道普通变量读入常见写法是 <code>scanf(&quot;%d&quot;, &amp;x)</code>。</li><li><input readOnly="" type="checkbox"/> 我知道读字符时常用 <code>scanf(&quot; %c&quot;, &amp;ch)</code>。</li><li><input readOnly="" type="checkbox"/> 我能用 <code>if/else if/else</code> 写互斥区间。</li></ul><h2 id="">引用</h2><ul><li>[S003] COMP1511 Lab Exam public information page: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/labexam/index.html">https://cgi.cse.unsw.edu.au/~cs1511/current/labexam/index.html</a></li><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S008] Lecture 2 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_1/COMP1511_26T1_Lecture02.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_1/COMP1511_26T1_Lecture02.pdf</a></li><li>[S009] Lecture 3 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture03.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture03.pdf</a></li><li>[S010] Lecture 4 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture04.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture04.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-02-variables-input-branching#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-02-variables-input-branching</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-02-variables-input-branching</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Mon, 18 May 2026 15:27:00 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 3 课：循环、函数与数组]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-03-loops-functions-arrays">https://rakko.cn/posts/comp1511/comp1511-03-loops-functions-arrays</a></blockquote><div><h1 id="-3-">第 3 课：循环、函数与数组</h1><blockquote><p>非 UNSW 官方材料。本文基于官方 functions、style、1D array、2D array 和 strings 相关 lecture PDF 做中文转述；所有练习模板为原创。<span>[S011][S012]</span><span>[S013][S014]</span>[S015]</p></blockquote><blockquote>
<p>今天只做：写一个 <code>for</code> 循环，能安全访问 <code>array[i]</code>。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-02-variables-input-branching">上一课</a> · <a href="/posts/comp1511/comp1511-04-debugging-strings-exam-drill">下一课：debugging、字符串与模拟考试</a>
别乱跳：数组题先找下标，不先背一整章。</p></blockquote>
<h2 id="">循环：重复做同一件事</h2><p>Lecture 3/4 把 loop 放进 control flow，Lecture 6 进入 arrays；数组题其实就是“用循环访问很多格子”，所以你先把 <code>for</code> 读顺。<span>[S009][S010]</span>[S012]</p><pre class="language-c lang-c"><code class="language-c lang-c">for (int i = 0; i &lt; size; i++) {
    printf(&quot;%d\n&quot;, i);
}
</code></pre>
<p>这段的读法是：<code>i</code> 从 0 开始；只要 <code>i &lt; size</code> 就继续；每轮后 <code>i++</code>。这个解释是本站原创，但结构来自 C 的基础控制流和数组访问。<span>[S006][S012]</span></p><h2 id="">函数题：先看题目让不让输出</h2><p>Lecture 5 把 functions 和 style 放在同一课，Style Guide 也强调代码布局、函数和限制；Exam 练习里常见坑是题目要 <code>return</code>，你却写了 <code>printf</code>。<span>[S011][S005]</span></p><table><thead><tr><th> 题目说法 </th><th> 你该怎么做 </th></tr></thead><tbody><tr><td> should return </td><td> 用 <code>return 值;</code> </td></tr><tr><td> should not print </td><td> 不要写 <code>printf</code> </td></tr><tr><td> should not scan </td><td> 不要写 <code>scanf</code> </td></tr></tbody></table><h2 id="1d-array-">1D array 模板：找位置，再处理附近</h2><p>Lecture 6 开始看 arrays，并把函数和数组放在一起复习；下面的模板不是官方题目，是用于练“找目标下标”的原创模式。[S012]</p><pre class="language-c lang-c"><code class="language-c lang-c">int index_of_first(int values[], int size, int target) {
    for (int i = 0; i &lt; size; i++) {
        if (values[i] == target) {
            return i;
        }
    }

    return -1;
}
</code></pre>
<details><summary>点开：为什么找不到时返回 -1？</summary><p>数组合法下标从 0 开始，<code>-1</code> 不是合法下标，所以常被用来表示“没找到”。这是原创约定讲解；真正考试里要以题目要求为准。[S012]</p></details><h2 id="2d-array-">2D array 模板：外层行，内层列</h2><p>Lecture 7/8/9 都围绕 strings、array of arrays 和 2D arrays 继续展开；二维数组先按“行 row + 列 col”读，不要一上来想复杂图形。<span>[S013][S014]</span>[S015]</p><pre class="language-c lang-c"><code class="language-c lang-c">#define NUM_COLS 6

int count_rows_with_even_sum(int array[][NUM_COLS], int num_rows) {
    int rows = 0;

    for (int row = 0; row &lt; num_rows; row++) {
        int sum = 0;

        for (int col = 0; col &lt; NUM_COLS; col++) {
            sum += array[row][col];
        }

        if (sum % 2 == 0) {
            rows++;
        }
    }

    return rows;
}
</code></pre>
<p>最容易错的是把 <code>sum</code> 放到外层循环外面；每一行都要重新计数，这个模式对应 2D array 题的基本循环结构。<span>[S014][S015]</span></p><h2 id="">本课过关标准</h2><ul><li><input readOnly="" type="checkbox"/> 我能写 <code>for</code> 循环访问 <code>array[i]</code>。</li><li><input readOnly="" type="checkbox"/> 我会先看函数题能不能 <code>printf</code> / <code>scanf</code>。</li><li><input readOnly="" type="checkbox"/> 我知道 2D array 常写 <code>array[row][col]</code>。</li><li><input readOnly="" type="checkbox"/> 我知道每一行的临时计数要在外层循环里重置。</li></ul><h2 id="">引用</h2><ul><li>[S005] COMP1511 Style Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S009] Lecture 3 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture03.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture03.pdf</a></li><li>[S010] Lecture 4 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture04.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_2/COMP1511_26T1_Lecture04.pdf</a></li><li>[S011] Lecture 5 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture05.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture05.pdf</a></li><li>[S012] Lecture 6 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture06.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_3/COMP1511_26T1_Lecture06.pdf</a></li><li>[S013] Lecture 7 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf</a></li><li>[S014] Lecture 8 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf</a></li><li>[S015] Lecture 9 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_5/COMP1511_26T1_Lecture09.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-03-loops-functions-arrays#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-03-loops-functions-arrays</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-03-loops-functions-arrays</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Mon, 18 May 2026 15:26:00 GMT</pubDate></item><item><title><![CDATA[COMP1511 第 4 课：debugging、字符串与模拟考试]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/comp1511/comp1511-04-debugging-strings-exam-drill">https://rakko.cn/posts/comp1511/comp1511-04-debugging-strings-exam-drill</a></blockquote><div><h1 id="-4-debugging">第 4 课：debugging、字符串与模拟考试</h1><blockquote><p>非 UNSW 官方材料。本文基于 Debugging Guide、Lab Exam 信息页、strings/2D array lecture 和 C reference sheet 做中文转述；不复制官方 exam 题目或样例。<span>[S004][S003]</span><span>[S014][S006]</span></p></blockquote><blockquote>
<p>今天只做：把错误分成 compile、autotest、runtime、logic 其中一类。
下一步：<a href="/posts/comp1511/comp1511-start-here">主控台</a> · <a href="/posts/comp1511/comp1511-03-loops-functions-arrays">上一课</a> · <a href="/posts/comp1511/comp1511-05-2d-arrays-strings-structs">下一课：strings、2D arrays 与 structs</a>
别乱跳：先看第一条错误，不整题重写。</p></blockquote>
<h2 id="debugging">debugging：先分类，不要乱猜</h2><p>Debugging Guide 把问题分成 compile error、autotest error、run time error 和 logic error；你明天考试时先判断是哪一类，再决定看报错、看输出差异、还是补边界测试。[S004]</p><table><thead><tr><th> 症状 </th><th> 先查什么 </th></tr></thead><tbody><tr><td> 编译后马上报错 </td><td> 看第一条错误、行号和 dcc 解释 </td></tr><tr><td> autotest 不过 </td><td> 先挑一个失败测试，看你的输出和期望输出差异 </td></tr><tr><td> 运行中崩掉 </td><td> 检查数组下标、除以 0、输入是否读到 </td></tr><tr><td> 结果不对 </td><td> 检查条件边界、循环次数和初始化位置 </td></tr></tbody></table><h2 id="-char-array-">字符串：先当 char array 看</h2><p>Lecture 7/8 把 strings 和 arrays 放在一起讲，C reference sheet 也列出 <code>string.h</code> 中常见函数；Exam 1 急救时先掌握 <code>char</code> 数组和 <code>&#x27;\0&#x27;</code> 结束标记，再考虑库函数。<span>[S013][S014]</span>[S006]</p><pre class="language-c lang-c"><code class="language-c lang-c">char word[51];
fgets(word, 51, stdin);

int i = 0;
while (word[i] != &#x27;\0&#x27;) {
    i++;
}
</code></pre>
<p>如果题目要求逐字符处理，就用下标循环读 <code>word[i]</code>。下面是原创练习模板，用来训练“遇到某个字符就改掉”。[S014]</p><pre class="language-c lang-c"><code class="language-c lang-c">int i = 0;
while (word[i] != &#x27;\0&#x27;) {
    if (word[i] == &#x27;x&#x27;) {
        word[i] = &#x27;y&#x27;;
    }
    i++;
}
</code></pre>
<details><summary>点开：什么时候不用 scanf(&quot;%s&quot;, word)？</summary><p>如果你需要读入包含空格的一整行，<code>scanf(&quot;%s&quot;, word)</code> 会在空白处停下；<code>fgets</code> 更适合整行输入。具体考试能不能用某个函数，仍然以题目限制和 Style Guide/lecture 覆盖范围为准。<span>[S005][S006]</span>[S014]</p></details><h2 id="30-">30 分钟模拟节奏</h2><p>Lab Exam 信息页公开说明示例考试有阅读时间、工作时间、题量、分值不均和 autotest/fetch 相关命令；这里不复刻题目，只把这些高层规则转成做题节奏。[S003]</p><ol start="1"><li>5 分钟：只读题，标出每题是否要 <code>return</code>、是否禁止 <code>printf</code> / <code>scanf</code>。</li><li>10 分钟：先做最熟的数组循环题。</li><li>10 分钟：做 2D array 或 string 题，先写循环框架。</li><li>5 分钟：按 Debugging Guide 分类查错，优先修编译和输出格式。[S004]</li></ol><h2 id="">最后检查清单</h2><ul><li><input readOnly="" type="checkbox"/> 我每题都保存了文件。</li><li><input readOnly="" type="checkbox"/> 我至少重新编译过一次。</li><li><input readOnly="" type="checkbox"/> 我按公开说明使用允许的 autotest/fetch 命令，而不是把题目内容搬到公开地方。[S003]</li><li><input readOnly="" type="checkbox"/> 我检查了输出大小写、空格和换行。</li><li><input readOnly="" type="checkbox"/> 我没有使用题目或 Style Guide 不允许的语言特性。[S005]</li></ul><h2 id="">引用</h2><ul><li>[S003] COMP1511 Lab Exam public information page: <a href="https://cgi.cse.unsw.edu.au/~cs1511/current/labexam/index.html">https://cgi.cse.unsw.edu.au/~cs1511/current/labexam/index.html</a></li><li>[S004] COMP1511 Debugging Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/debugging_guide.html</a></li><li>[S005] COMP1511 Style Guide: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/style_guide.html</a></li><li>[S006] COMP1511 C reference sheet PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/resources/c-reference-sheet.pdf</a></li><li>[S013] Lecture 7 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture07.pdf</a></li><li>[S014] Lecture 8 PDF: <a href="https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf">https://cgi.cse.unsw.edu.au/~cs1511/26T1/slides/week_4/COMP1511_26T1_Lecture08.pdf</a></li></ul><script id="comp1511-checklist-enhancer">(() => {
  const storagePrefix = 'comp1511-checklist:v1:'
  const readText = (element) => (element?.innerText || element?.textContent || '').replace(/\s+/g, ' ').trim()
  const enhance = () => {
    const root = document.getElementById('main-content-render') || document.querySelector('article') || document
    const checkboxes = Array.from(root.querySelectorAll('input[type="checkbox"]'))

    checkboxes.forEach((checkbox, index) => {
      const item = checkbox.closest('li')
      const label = readText(item || checkbox.parentElement).slice(0, 80)
      const key = storagePrefix + location.pathname.replace(/\/+$/, '') + ':' + index + ':' + label

      if (item) {
        item.style.listStyle = 'none'
        item.style.display = 'flex'
        item.style.alignItems = 'flex-start'
        item.style.gap = '0.65em'
        item.style.marginLeft = '0'
        item.style.cursor = 'pointer'
      }

      if (!checkbox.dataset.comp1511ChecklistReady) {
        checkbox.dataset.comp1511ChecklistReady = 'true'
        checkbox.readOnly = false
        checkbox.disabled = false
        checkbox.removeAttribute('readonly')
        checkbox.style.cursor = 'pointer'
        checkbox.style.flex = '0 0 auto'
        checkbox.style.marginTop = '0.35em'
        checkbox.style.pointerEvents = 'none'

        const save = () => {
          try {
            localStorage.setItem(key, checkbox.checked ? '1' : '0')
          } catch {}
        }
        const toggle = () => {
          checkbox.checked = !checkbox.checked
          save()
        }

        checkbox.addEventListener('keydown', (event) => {
          if (event.key !== ' ' && event.key !== 'Enter') return
          event.preventDefault()
          toggle()
        })
        checkbox.addEventListener('change', save)

        item?.addEventListener('click', (event) => {
          const target = event.target
          if (target === checkbox || target.closest?.('a, button, input, summary, details, pre')) return
          toggle()
        })
      }

      try {
        const saved = localStorage.getItem(key)
        if (saved !== null) checkbox.checked = saved === '1'
      } catch {}
    })
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', enhance, { once: true })
  } else {
    enhance()
  }
  setTimeout(enhance, 250)
  setTimeout(enhance, 1000)
  window.addEventListener('resize', () => setTimeout(enhance, 100), { passive: true })
})()
</script></div><p style="text-align:right"><a href="https://rakko.cn/posts/comp1511/comp1511-04-debugging-strings-exam-drill#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/comp1511/comp1511-04-debugging-strings-exam-drill</link><guid isPermaLink="true">https://rakko.cn/posts/comp1511/comp1511-04-debugging-strings-exam-drill</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Mon, 18 May 2026 15:25:00 GMT</pubDate></item><item><title><![CDATA[微积分定理秒杀关键词速记]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/mathematics/calculus-theorem-speedrun">https://rakko.cn/posts/mathematics/calculus-theorem-speedrun</a></blockquote><div><p><strong>这是最新文档</strong></p><h2 id="intermediate-value-theorem----ivt">Intermediate Value Theorem (介值定理 - IVT)</h2><p>秒杀关键词： continuous (连续), opposite signs (一正一负), root (根), exists c such that f(c) = 0 (存在c使得函数值等于某数)。</p><p>大白话： 从A点走到B点，如果一个在水面上，一个在水面下，那你肯定得穿过水面。你刚才做对的那道平面题就是这个。</p><h2 id="mean-value-theorem----mvt">Mean Value Theorem (中值定理 - MVT)</h2><p>秒杀关键词： derivative (导数), $f&#x27;(c)$, rate of change (变化率), tangent parallel to secant (切线平行于割线)。</p><p>大白话： 你开车从悉尼去堪培拉，平均时速是 $100$。那路上肯定有那么一瞬间，你的仪表盘速度刚好指在 $100$ 上。只要题目扯到导数和平均变化的关系，闭眼选它。</p><h2 id="maximum-minimum-theorem---">Maximum-Minimum Theorem (极值定理 / 最值定理)</h2><p>秒杀关键词： closed interval (闭区间 $[a,b]$), maximum / minimum (最大值/最小值), bounded (有界的)。</p><p>大白话： 一段连绵不断的山脉，只要圈定一个明确的起点和终点，里面绝对能找出一个最高峰和一个最低谷。</p><h2 id="second-fundamental-theorem-of-calculus-">Second Fundamental Theorem of Calculus (微积分基本定理第二部分)</h2><p>秒杀关键词： 题目里同时出现了积分号 $\int$ 和 求导符号 $\frac{d}{dx}$。</p><p>大白话： 积分的上限是个变量 $x$，然后让你对整个积分式子求导。这就是微积分的核心——求导和积分是逆运算。</p><h2 id="inverse-function-theorem-">Inverse Function Theorem (反函数定理)</h2><p>秒杀关键词： $f^{-1}$, one-to-one (一一映射), inverse (反函数)。</p><p>大白话： 专门用来算反函数的导数的。原函数某点的斜率如果是 $2$，反函数对应点的斜率就是 $\frac{1}{2}$。</p><h2 id="fundamental-theorem-of-algebra-">Fundamental Theorem of Algebra (代数基本定理)</h2><p>秒杀关键词： polynomial (多项式), complex roots (复数根)。</p><p>大白话： $n$ 次多项式必定有 $n$ 个复数根。这在你们这门微积分课里多半是个凑数的干扰项。</p><h2 id="split-function-theorem-">Split Function Theorem (分段函数定理)</h2><p>秒杀关键词： piecewise function (分段函数)，检查连接点 (break point)。</p><p>大白话： 就是左极限等于右极限，左导数等于右导数那套东西。</p></div><p style="text-align:right"><a href="https://rakko.cn/posts/mathematics/calculus-theorem-speedrun#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/mathematics/calculus-theorem-speedrun</link><guid isPermaLink="true">https://rakko.cn/posts/mathematics/calculus-theorem-speedrun</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Mon, 04 May 2026 23:00:00 GMT</pubDate></item><item><title><![CDATA[逻辑题真值表速通：Part a / Part b 一分钟搞定]]></title><description><![CDATA[<link rel="preload" as="image" href="https://github.com/KurisuRakko/picx-images-hosting/raw/master/yohaku/posts/truth-table-speedrun/pic1.png"/><link rel="preload" as="image" href="https://github.com/KurisuRakko/picx-images-hosting/raw/master/yohaku/posts/truth-table-speedrun/pic2.png"/><link rel="preload" as="image" href="https://github.com/KurisuRakko/picx-images-hosting/raw/master/yohaku/posts/truth-table-speedrun/pic3.png"/><div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://rakko.cn/posts/productivity/truth-table-speedrun">https://rakko.cn/posts/productivity/truth-table-speedrun</a></blockquote><div><h2 id="">第一步：死记四个符号的“作弊规则”</h2><p><img alt="图一：第一组真值表题目截图" src="https://github.com/KurisuRakko/picx-images-hosting/raw/master/yohaku/posts/truth-table-speedrun/pic1.png"/></p><p>不要管它们叫什么“合取”、“析取”，你只需要记住它们像什么人：</p><ul><li>∼ <strong>（波浪号）= 杠精。</strong> 专门唱反调。看到 T 就写 F，看到 F 就写 T。</li><li>∧ <strong>（尖尖朝上）= 挑剔狂。</strong> 必须左右两个都是 T，结果才是 T。只要看到哪怕一个 F，结果直接写 F。</li><li>∨ <strong>（圆圆朝下）= 老好人。</strong> 只要左右看到哪怕一个 T，结果就是 T。只有两个都是 F 时，他才勉强写 F。</li><li>→ <strong>（箭头）= 渣男背叛。</strong> 这是唯一需要注意顺序的！<strong>只有</strong>前面是 T，后面是 F （即 T→F）时，结果才是 F（承诺了却做不到，渣男）。其他所有情况（哪怕是 F→F），结果全写 T。</li></ul><h2 id="-part-a">第二步：光速填表 (Part a)</h2><p><img alt="图二：第二组真值表题目截图" src="https://github.com/KurisuRakko/picx-images-hosting/raw/master/yohaku/posts/truth-table-speedrun/pic2.png"/></p><p>用上面这四个规则，你可以直接无脑填表了。我拿<strong>图一</strong>给你举个例子，考场上你就按这个步骤在草稿纸上比划：</p><ol start="1"><li><p><strong>看第一列</strong> ∼p∨q</p><ul><li>先看 p，在心里把它“杠”一下（T, T, F, F 变成 F, F, T, T）。</li><li>然后把这串新结果和 q 放在一起，用“老好人” ∨ 规则。</li><li>第一行：F∨T=T</li><li>第二行：F∨F=F</li><li>第三行：T∨T=T</li><li>第四行：T∨F=T</li><li><strong>填表答案就是：T, F, T, T</strong></li></ul></li><li><p><strong>看第二列</strong> p→∼q</p><ul><li>把 q 在心里“杠”一下（变成 F, T, F, T）。</li><li>把 p 放在前面，新 q 放在后面，找“渣男”情况（前 T 后 F）。</li><li>第一行：T→F （抓到渣男了！） =F</li><li>第二行：T→T=T</li><li>第三行：F→F=T</li><li>第四行：F→T=T</li><li><strong>填表答案就是：F, T, T, T</strong></li></ul></li></ol><p><em>(图二和图三完全是一模一样的机械动作，按规则套就完事了。)</em></p><h2 id="-part-b">第三步：秒杀 Part b（终极作弊技巧）</h2><p><img alt="图三：第三组真值表题目截图" src="https://github.com/KurisuRakko/picx-images-hosting/raw/master/yohaku/posts/truth-table-speedrun/pic3.png"/></p><p>这里有个天大的捷径，你发现了吗？<strong>Part b 下面的那串又长又恶心的公式，括号里的内容，其实就是你在 Part a 刚刚填完的那两列！</strong></p><p>你根本不需要从头算，直接把你表里的答案代进去！</p><p>你要选的三个英文单词的意思：</p><ul><li><strong>Tautology</strong> (永真式)：最后算出来四个全是 T。</li><li><strong>Contradiction</strong> (矛盾式)：最后算出来四个全是 F。</li><li><strong>Contingency</strong> (偶然式)：有 T 有 F。</li></ul><p><strong>实战演示：</strong></p><p><strong>图一的 (b)：</strong> ∼(p→∼q)→∼(∼p∨q)</p><ul><li>前半部分 (p→∼q) 就是你的第二列答案（F, T, T, T）。</li><li>后半部分 (∼p∨q) 就是你的第一列答案（T, F, T, T）。</li><li>公式翻译过来就是：∼(第二列)→∼(第一列)。</li><li>我们只测第一行：第二列是 F，第一列是 T。代进去：∼F→∼T，也就是 T→F。触发渣男规则，结果是 <strong>F</strong>。</li><li>我们再测第二行：第二列是 T，第一列是 F。代进去：∼T→∼F，也就是 F→T。不是渣男，结果是 <strong>T</strong>。</li><li><strong>出结果了！</strong> 有 F 有 T，不用再往下算了，直接选 <strong>Contingency</strong>。</li></ul><p><strong>图二的 (b)：</strong> ∼(∼p→q)∧(p∧∼q)</p><ul><li>翻译：∼(第二列)∧(第一列)。</li><li>你自己算一下第一列的结果是：F, T, F, F。第二列的结果是：T, T, T, F。</li><li>用挑剔狂 ∧ 规则代入测试。你会发现每一行算出来都是 F。</li><li>四个全 F，直接选 <strong>Contradiction</strong>。</li></ul><p><strong>图三的 (b)：</strong> (∼p∨∼q)∨∼(p∧q)</p><ul><li>翻译：(第二列)∨∼(第一列)。</li><li>第一列结果：T, F, F, F。第二列结果：F, T, T, T。</li><li>第一行代入：F∨∼T，即 F∨F=F。</li><li>第二行代入：T∨∼F，即 T∨T=T。</li><li>有 F 有 T，选 <strong>Contingency</strong>。</li></ul><p>就这么简单。把那四个小符号的性格记住，拿笔在纸上标一下，这几道题一分钟就能填完。</p></div><p style="text-align:right"><a href="https://rakko.cn/posts/productivity/truth-table-speedrun#comments">览毕，何不一言？</a></p></div>]]></description><link>https://rakko.cn/posts/productivity/truth-table-speedrun</link><guid isPermaLink="true">https://rakko.cn/posts/productivity/truth-table-speedrun</guid><dc:creator><![CDATA[KurisuRakko]]></dc:creator><pubDate>Sat, 18 Apr 2026 14:01:00 GMT</pubDate></item></channel></rss>