期末考-1111405038-俞星合 - #1331
Open
H-HoYu wants to merge 10 commits into
Open
期末考-1111405038-俞星合#1331H-HoYu wants to merge 10 commits into
H-HoYu wants to merge 10 commits into
Conversation
This reverts commit ac4ec36.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caesar Cipher 題目 - RP 摘要
📋 題目摘要
題目名稱
凱撒密碼(Caesar Cipher)- 第二題
題目需求
對輸入的每一行文字,完成三個步驟:
核心演算法
範例
輸入:
輸出:
過程說明:
行1: Hello, NPU!
行2: abc XYZ
行3: ABCXYZ → JKLGHI (全大寫)
✅ 測試結果
測試執行輸出
測試涵蓋項目
Hello, NPU!Qnuux, WYD!abc XYZjkl GHIABCXYZJKLGHI123 !@#123 !@#Test123!@#XYZCnbc123!@#GHI結果:6/6 通過(綠燈 ✅)
🔧 我跟 AI 改了什麼地方
改動 1:題目整理與驗證
原始問題: 需要從照片題目整理完整的題目分析檔,SHIFT=9
AI 給的方案:
我的判斷與修改:
改動 2:紅燈測試設計
原始問題: 需要設計至少 3 個測試案例
AI 給的方案:
我的判斷與修改:
改動 3:解題檔實作與預期輸出修正(關鍵)
原始問題: 需要實作 solution.py,使所有 6 個測試案例通過
AI 給的方案:
caesar_encrypt(text, shift=9)函數實作(ord(char) - ord('A') + shift) % 26 + ord('A')main()處理 EOF我的判斷與修改(重點):
Test 1 修正:
Hello, NPU!Qsvvb, WYD!(e 誤算成 s)Qnuux, WYD!(e +9 = n)Test 6 修正:
Test123!@#XYZ錯誤預期:
Cyvg123!@#GHI(s, t 誤算)正確預期:
Cnbc123!@#GHI(T→C, e→n, s→b, t→c 正確)驗證:各字符位移都符合 (pos + 9) % 26
✅ 修正後所有 6 個測試通過(綠燈 ✅)
影響: 預期輸出正確與否直接決定了測試是否通過,需要逐字符驗證 SHIFT=9 的計算。
改動 4:邊界情況處理驗證
原始問題: 確保所有邊界情況都被正確處理
AI 給的方案:
我的判斷與修改:
📊 改動統計
關鍵修改: 預期輸出的手工驗證(Test 1 和 Test 6),涉及逐字符計算 SHIFT=9 的位移,影響整個綠燈測試結果。
📝 最終評語
✅ 題目分析: 完整,SHIFT=9 邏輯清晰
✅ 測試設計: 6 個案例,涵蓋所有邊界情況(繞回、空行、非字母、混合)
✅ 實現驗證: 所有測試通過(6/6 綠燈),預期輸出經過逐字符驗證
✅ 改動記錄: 關鍵修改(預期輸出修正)有明確的判斷依據和計算過程
本題目完全符合「只做我要求的」原則,特別是預期輸出修正體現了對 SHIFT=9 計算的深度驗證。