RICKY CHEN
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 本共筆由服務學習程設小天使們共同製作 若有任何問題,可於公布之時間來圖書館B1影音討論室找我們呦! ## Chapter2 資料型別與主控台應用程式(3/20內容) :::success 本章由我陳宇翔負責,內容不會以課本順序,但會涵蓋到本章所有內容與老師提到的概念,若有錯誤可直接聯絡我修正,萬分感謝! ::: (這邊之後做目錄) ### 一、開發環境建置與作業繳交方式(對應課本2.3) :::info :bulb: 這裡的教學環境以課本提到window環境為主,Mac使用者敬請見諒 ::: #### (一)開發環境建置 1.安裝Visual Studio2019 (2022會隱藏using、class等預載程式碼,交作業可能會有問題) https://visualstudio.microsoft.com/zh-hant/vs/older-downloads/ 2.請勾選.NET桌面開發的選項並將右邊的.NET相關的選項都打勾 ![螢幕擷取畫面 2024-03-20 160924](https://hackmd.io/_uploads/B1wgqGOCp.png) 3.建立新專案時,打開vs後按右下角的建立新專案 ![螢幕擷取畫面 2024-03-20 161755](https://hackmd.io/_uploads/rkORjzOC6.png) 4.會進到如下頁面,請利用篩選器找出「C#的主控台應用程式」 :::info 注意不要選課本內容後綴有(.NET Framework)的主控台應用程式呦~ ::: ![螢幕擷取畫面 2024-03-20 161946](https://hackmd.io/_uploads/SkdC3M_Ra.png) 5.點選後進入如下頁面,此處可以設定**專案名稱**、**路徑**等。 :::info 建議開專案時就將名稱設定好,因為後期改名字不像.py可以重新命名較為麻煩, 而路徑盡量放在桌面或特定資料夾,win11預設在user裡面不太好找。 ::: ![螢幕擷取畫面 2024-03-20 162632](https://hackmd.io/_uploads/H1gjRGdRp.png) 6.按下下一步後會進到如下頁面,**注意請不要選超過6.0以上的Framework架構**,預設的程式碼會隱藏消失,若後期需要更高版本的Framework可以在後期進行調整。 ![螢幕擷取畫面 2024-03-20 163040](https://hackmd.io/_uploads/rkMHk7d0p.png) 7.若建立專案後顯示如下,噹噹!恭喜各位完成開發環境建置囉! :bulb: 小提醒:若想更改背景及字型行距等外觀,可至工具列的選項進行調整 ![螢幕擷取畫面 2024-03-20 163406](https://hackmd.io/_uploads/Bkzj1QdCp.png) (本節完) --- #### (二)作業繳交方式 檔案會存在上面環境建置的第五步中的路徑以資料夾的方式呈現,目前老師有提到兩種繳交方式。![螢幕擷取畫面 2024-03-20 164608](https://hackmd.io/_uploads/B1JB7X_Ra.png) 第一種:將整個資料夾複製一分至新資料夾內,並附上環境檔壓縮成.zip後交出 * 環境檔:內容要有姓名學號+開發環境 ![螢幕擷取畫面 2024-03-20 165211](https://hackmd.io/_uploads/B18gEmOAT.png) * 新資料夾:檔名請改成老師要求的形式壓縮後交出 ![螢幕擷取畫面 2024-03-20 165442](https://hackmd.io/_uploads/SJ98B7dAT.png) 第二種:僅繳交資料夾的Program.cs檔,繳交前請將檔名改成老師要求的形式**不用壓縮** ![螢幕擷取畫面 2024-03-20 170032](https://hackmd.io/_uploads/BybTrXd0p.png) (本節完) ### 二、C#資料型別與型別轉換(對應課本2.1、2.5) 與Python不同的是,c#為**強型別**的程式語言,所有變數皆須事先宣告型別才不會報錯呦! #### (一)變數名稱 * 變數不得使用c#的預設關鍵字(keywords),非得使用時前綴@ * 數字0~9不能開頭 * 大小寫意義不同 * 可用中文、部分符號但不建議使用 #### (二)實質與參考型別 :::info 簡單來說,實質型別就是該物件直覺的放在該處(A住在他家),參考型別為(B其實住C家,但B家有他的C家住址),家代表的是記憶體位置,C家為堆積區,AB家則是堆疊區。 ::: * 網站參考: https://xianlee.gitbooks.io/csharp-basic/content/syntax/valuetype.html https://medium.com/ninas-note/c-%E5%AF%A6%E8%B3%AA%E5%9E%8B%E5%88%A5-value-type-vs%E5%8F%83%E8%80%83%E5%9E%8B%E5%88%A5-reference-type-64ba5cf8bf8b * 樹狀圖: ![螢幕擷取畫面 2024-03-20 172551](https://hackmd.io/_uploads/Hk_3sQ_0p.png) * **實質型別:** | 型別(關鍵字) | 範圍實數 | 2次方/精確度 | 大小 | | ------------ | ----------------------------------------- | ------------ | --------- | | sbyte | -128~127 | 7次 | 有號8bit | | byte | 0~255 | 8次 | 無號8bit | | short | -32768~32767 | 15次 | 有號16bit | | ushort | 0~65535 | 16次 | 無號16bit | | int | -2147483648~2147483647 | 31次 | 有號32bit | | uint | 0~4294967295 | 32次 | 無號32bit | | long | -9223372036854775808~ 9223372036854775807 | 63次 | 有號64bit | | ulong | 0~18446744073709551615 | 64次 | 無號64bit | | float | 約±1.5x10^43 ~ ±3.4x10^38 | 約6~9位數 | 64bit | | double | 約±5.0×10^324 ~ ±1.7×10^308 | 約15~17位數 | 128bit | | decimal | 約±1.0x10^28 ~ ±7.9228x10^28 | 約28~29位數 | 256bit | | bool | ture/false | 無 | 32bit | | char | 一個Unicode的字元 | 無 | 16bit | 註:**列舉**(enum)、**結構**(struct),也屬於實質型別的一種,課本2.6、2.7有分別敘述。 * **參考型別:** 物件(object)、字串(string)、列別(class)、介面(interface)、委派(delegate)、陣列(array)皆為參考型別,後面的章節會再詳細敘述。 #### (三)型別之轉換(對應課本2.5) * 轉換總表: | 目標型別/原型別 | sbyte | byte | short | ushort | int | uint | long | ulong | float | double | decimal | char | | ------------------ | ----- | ---- | ----- | ------ | --- | ---- | ---- | ----- | ----- | ------ | ------- | ---- | | sbyte(有號8bit) | 無 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | | byte(無號8bit) | 明 | 無 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | | short(有號短整數) | 隱 | 隱 | 無 | 明 | 明 | 明 | 明 | 明 | 明2 | 明2 | 明2 | 明 | | ushort(無號短整數) | 明 | 隱 | 明 | 無 | 明 | 明 | 明 | 明 | 明2 | 明2 | 明2 | 隱 | | int(有號整數) | 隱 | 隱 | 隱 | 隱 | 無 | 明 | 明 | 明 | 明2 | 明2 | 明2 | 隱 | | uint(無號整數) | 明 | 隱 | 明 | 隱 | 明 | 無 | 明 | 明 | 明2 | 明2 | 明2 | 隱 | | long(有號長整數) | 隱 | 隱 | 隱 | 隱 | 隱 | 隱 | 無 | 明 | 明2 | 明2 | 明2 | 隱 | | ulong(無號長整數) | 明 | 隱 | 明 | 隱 | 明 | 隱 | 明 | 無 | 明2 | 明2 | 明2 | 隱 | | float(浮點數) | 隱 | 隱 | 隱 | 隱 | 隱1 | 隱1 | 隱1 | 隱1 | 無 | 明5 | 明4 | 隱 | | double(倍精確浮點) | 隱 | 隱 | 隱 | 隱 | 隱 | 隱 | 隱1 | 隱1 | 隱 | 無 | 明4 | 隱 | | decimal(貨幣) | 隱 | 隱 | 隱 | 隱 | 隱 | 隱 | 隱 | 隱 | 明3 | 明3 | 無 | 隱 | | char(字元) | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 明 | 無 | * 隱含轉換(隱):又稱自動轉換,除了有附註1外的,皆可以直接轉換不會遺失資料,語法為`i = f` (i與f為不同型別但可直接指定) * 明確轉換(明):又稱強制轉換,依照類型可能會產生不同的轉換結果(以附註的方式呈現),必須利用`i = (cast)f`的語法,cast為欲轉換的型別,省略會報錯。 * 註1:可能導致精度遺失,但大小正確 * 未附註之其他明確轉換:若超過目標型別之範圍,出現溢位bug或顯示0。 * 註2:小數部分消失,若超過目標型別之範圍,出現溢位bug或顯示為0。 * 註3:轉換值以十進位表示之,四捨五入接近10^-28位。 * 註4:四捨五入接近目標型別值。 * 註5:四捨五入接近目標型別值,若超過目標型別之範圍,出現溢位bug或顯示為無窮大。 微軟官方技術支援:https://learn.microsoft.com/zh-tw/dotnet/csharp/language-reference/builtin-types/numeric-conversions#explicit-numeric-conversions ### 三、C#的運算(對應課本2.2) #### (一)運算子與運算元 * 運算元(operand):要進行運算的變數或數字,如```i*3```時```i```與```3```皆為運算元。 * 運算子(operator):指定資料做運算,如```i*3```時,```*```就是一個二元運算子,運算子可依照使用的運算元分為單元(```i++```)、二元、三元運算子。 #### (二)算數運算子 共有加`+`、減`-`、乘`*` 、除`/`、取`%`餘五種 * 形式為```i = a + b```(順序與python一樣為先相加後指定) :::danger **注意除`/`用整數類的型別相除只會得出整數(省略後綴小數點),若求含小數點的商,需先將運算元轉換為浮點數類的型別(如```float、double```)。** ::: #### (三)關係運算子 * 有相等`==`、不相等`!=`、大於`>`、小於`<`、大於或等於`>=`、小於或等於`<=`六種 * 形式為```k = i <= 3```,k得到的是i與3的比較結果(布林值) * 將兩運算元進行運算後,回傳**布林值**(`true/false`) * 注意`==`為相等,`=`為指定,兩種不一樣。 #### (四)邏輯運算子 * 有且(and)`&&`、或(or)`||`、非(not)`!`三種 * 且與或的形式可為`a>=b && c<d` 也就是比較兩布林值,依運算元回傳**布林值** * `&&`為左右皆真才回傳真,`||`只要有一邊為真,就回傳真。 * `!`形式可為`b = a!`,此時若a為真,b就為假,反之相同。 :::danger 注意不要與下述之位元運算子混淆,`&&`與`||`都是兩單位哦! ::: #### (五)位元運算子(不常用) * 有且(and)`&`、或(or)`|`、xor`^`、not`~`四種。 * 將數字換成2進位後進行邏輯運算 * **運算結果回傳數字** * 較常用用於通信、加密等較低階的語言內。 * 真值表與範例如下 ![1_9KKTFhcHxCejOZFzbWPOCw](https://hackmd.io/_uploads/SymJ67FAa.png) #### (六)移位運算子(不常用) * 有右移`>>`,左移`<<`兩種。 * 將數字換成2進位後進行左右移位。 * 基本上可當作*2或/2來看待,但有例外情況。 #### (七)複合指定運算子 * 將`a = a + 5`的形式省略為`a += 5`,一樣為先相加後指定回原變數。 * 注意左側不可為運算式或**常數** * 算術運算子、位元運算子、移位運算子皆可做此省略。 #### (八)遞增及遞減運算子 * 將`a = a + 1`或`a += 1`的語法省略為`a++`。 * 分為後置`a--`或前置`--a`運算。 * 後置代表先執行完其他運算後再將a+1,前置代表先將a+1後再做運算。 * 如`k = i++`則輸出值k小於i,`k = ++i`則輸出值相等。 * 盡量避免大量且複雜使用此運算子(可用括號代替),避免後續人員維護困難及增加可讀性。 #### (九)運算子的優先次序 :::danger **實務上老師建議使用小括號處理,避免混淆** ::: * 微軟官方的整理表格,網址如下 https://learn.microsoft.com/zh-tw/dotnet/csharp/language-reference/operators/#operator-precedence * 次序表截圖: ![螢幕擷取畫面 2024-03-21 201131](https://hackmd.io/_uploads/BJKWVoKA6.png) ### 四、主控台應用程式與格式化輸出入(對應課本2.4) #### (一)輸出入字串(使用Console類別) | 方法(Console.) | 意義 | | -------------- | ----------------------------------------------- | | .Write | 於主控台輸出 | | .WriteLine | 於主控台輸出並換行 | | .Read | 讀入一個**字元** | | .ReadLine | 讀入一個**字串**,若要讀入整數必須使用int.Parse方法 | | .ReadKey | 讀入一個字元後停止執行(通常放在結尾) | * int.Parse方法用於需要將字串型別轉成可運算之整數型別,屬於強制轉換的一種,語法為`var1 = int.Parse(ConSole.ReadLine("123"))`,var需先宣告為int。 #### (二)字串的串聯方式 ##### 1.合併運算子`+` * 語法`str1 = I'm`, `str2 = str1 + pig`,輸出值為`I'mpig` * 直觀的合併**字串(string)** ##### 2.字串格式化 * 與python的format語法類似,但不須於輸出值與變數間加上`.format`,而大括弧內需有表示位置之數字(由0起算) * 若使用`ConSole.WriteLine("{0}aaa{1}bbb",var1,var2)`的形式時,不須前綴`string.Format`語法,可直接套用。 * 在`str1 = string.Format("{0}的朋友是{1}",var1,var2)`的形式時,不得省略`string.Format`。 微軟官方技術資源: https://learn.microsoft.com/zh-tw/dotnet/api/system.string.format?view=net-8.0 ##### 3.字串插值`$` * 與python的引號前綴f語法類似。 * 語法為`str1 = $"{var1}的朋友有{var2 + 1}個"`,大括號內放入變數名,若為數值可於大括弧內放入運算式如`{var2 + 1}`。 #### (三)格式化輸出 | 格式字元 | 意義 | 格式 | input | output | 附註 | | -------- | -------- | ------- | --------- | ------------- | ----------------------------------------------------------------------- | | C | 貨幣 | {1,0:C} | 1234.567 | NT$1,234.57 | Currency :C預設到小數2位…C1取小數一位,C3取小數三位… | | Dn | 十進位 | {1,0:D} | 1234 | 1234 | Decimal: 只支援整數資料型別(integral types),D後面數字表示指定的位數 | | E | 科學指數 | {1,0:E} | 1234 | 1.234000E+003 | Scientific | | Fn | 固定 | {1,0:F} | 1234.4567 | 1234.46 | Fixed-point | | G | 一般 | {1,0:G} | 1234.567 | 1234.57 | General | | N | 數字 | {1,0:N} | 120000 | 120,000.00 | Number:每三位數用 "," 隔開 | | P | 百分比 | {1,0:P} | 0.25 | 25.00% | Percent:輸入數值*100 ; 預設取小數2位,P0可取小數 | | R | 來回 | {1,0:R} | 0.25 | 0.25 | Round-trip:只支援Double、Single | | X | 十六進位 | {1,0:R} | 123 | 7B | Hexadecimal:只支援整數資料型別(integral types) | * 格式中第一個1代表第幾個輸出位置(類似format用法),也可使用$方法直接填入變數。 * 格式中第二個0代表長度幾位(含輸出值所佔的位元),前綴負號表靠左顯示(預設靠右)。 * 格式中第三個英文代號為格式字元,依上面表格選取所欲輸出之方式填入,不分大小寫。 #### (四)自訂數值格式輸出字串(ToString方法) * 在欲輸出之變數名後.ToString,將數值以自己想要的方式輸出(不必轉換型別) | 格式字元 | 意義 | 格式 | 輸入 | 輸出 | 英文 | | -------- | ------------ | ----------- | ---- | ------- | ----------------- | | 0 | 零值預留位置 | ("000.000") | 12.3 | 012.300 | Zero placeholder | | # | 數字預留位置 | ("###.###") | 12.3 | 12.3 | Digit placeholder | | . | 小數點 | ("0.0") | 12.3 | 12.3 | Decimal point | | , | 千位分隔符號 | ("0,0") | 1200 | 1,200 | Thousand separator and number scaling | | % | 百分比預留位置 | ("0%") | 0.25 | 25% | Percentage placeholder | | e | 科學標記法 | ("0e+0") | 123 | 1.23e+2 | Scientific notation | | \ | 跳脫字元 | ("00\\n0") | 123 | 12(換行)3 | Escape character | 微軟官方技術支援: https://learn.microsoft.com/zh-tw/dotnet/standard/base-types/custom-numeric-format-strings 部落格整理: https://marcus116.blogspot.com/2018/10/c-stringformat.html #### (五)控制字元(\方法) * 在輸出字串內插入控制字元,可實現特定目的。 | 跳脫字元 | 功能說明 | | -------- | ---------------- | | \\' | 單引號 | | \\" | 雙引號 | | \\\ | 反斜線 | | \\a | 發出一聲警告 | | \\b | 倒退一個字元 | | \\f | Form Feed | | \\n | 換新行 | | \\r | 換行並移到最前方 | | \\t | 水平方向的Tab | | \\v | 垂直方向的Tab | ### 五、列舉資料型別(對應課本2.6) :::danger 注意定義列舉要在class與static void main敘述之間或於結構內進行定義 ![螢幕擷取畫面 2024-03-22 161344](https://hackmd.io/_uploads/HJLAan5Ca.png) ::: * 為同一種型別的「集合」 * 目的為增加可讀性與可維護性,利於檢查錯誤(非法值) * 語法為`(存取範圍) enum 列舉名 : 資料型別{成員1 = (初值1),成員2 = (初值2).....}` * 存取範圍欲設為private * 資料型別若省略,預設為int * 若成員不指定初值,預設由0開始 * 呼叫值時變數名稱為`列舉名.成員名` 微軟官方技術支援: https://learn.microsoft.com/zh-tw/dotnet/csharp/language-reference/builtin-types/enum ### 六、結構資料型別(對應課本2.6) :::danger 注意定義結構也要在class與static void main敘述之間或於結構內進行定義 ![螢幕擷取畫面 2024-03-22 161344](https://hackmd.io/_uploads/HJLAan5Ca.png) ::: * 代表著數種相關連但不同型別的資料,如學生很多但每個學生都有學號(string)、姓名(string)、成績(int)等相關連但不同型別的資料集。 * 定義完結構後只需宣告變數名為該結構型別,例:`Product stu1;`就可直接只用該結構,有點像套版的概念。 * 目的為可讀性與可維護性,避免生成大量變數。 * 設定語法為`(存取範圍) struct 結構名 {資料型別1 成員1 ;資料型別2 成員2 ;.....}` * 使用時變數名稱為`stu1.結構成員1` 微軟官方技術資源: https://learn.microsoft.com/zh-tw/dotnet/csharp/language-reference/builtin-types/struct 參考資料(結構與列舉)1 https://ithelp.ithome.com.tw/articles/10261964 參考資料(結構與列舉)2 http://kaiching.org/pydoing/cs-guide/unit-09-eunm-and-struct.html

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully