# hackMD 格式 請參考這篇的格式來進行文章撰寫,如果有沒涵蓋到的文章格式,你如果要用,請記得增加到這裡 詳細排版格式請見 [HackMD 使用教學](/fNYeUVJNQr6G6ZA5nwn9oA) ## 文章副標題(有兩個井字號的標題) 大小改成像這樣 <font size=6>文章副標題</font><br> ## 其他文章連結(放在文章開頭以及結尾,沒有的話還是要打"無" 然後還要記得縮排) ### 文章開頭 (最下面要加上"---) > 上一篇文章 [link text](https:// "title") > 下一篇文章 [link text](https:// "title") > 先備知識 [link text](https:// "title") > 延伸閱讀 [link text](https:// "title")/[link text2](https:// "title") --- ### 文章結尾 (最上面要加上"---") --- > 上一篇文章 [link text](https:// "title") > 下一篇文章 [link text](https:// "title") > 先備知識 [link text](https:// "title") > 延伸閱讀 [link text](https:// "title")/[link text2](https:// "title") ### 文章結尾(最後一個子主題) --- > 上一篇文章 [link text](https:// "title") > 下一篇文章 [link text](https:// "title") > 先備知識 [link text](https:// "title") > 延伸閱讀 [link text](https:// "title")/[link text2](https:// "title") > 觀念是非題 [link text](https:// "title") ## 其他文章連結(放在文章中) [《link text》](https:// "title") ## 小範例格式 綠色部分表示好的或正確的範例 紅色部分表示壞的或是錯誤範例 > ### 範例: 在已經排序好的數列中找到特定數字 > 我想要在 `1 21 38 49 500 679 7138 8879 9879 10123` 中找到 `8879` > :::success > ### 每次找都切一半 > 把數列剖半一次,找到 `500` 。 > `500`< `8879` ,因為數列有經過排序,所以我們知道`500` 左邊的數字也都小於 `8879`。 > 我們把他們都從可能性中踢除,使得數列剩下 `679 7138 8879 9879 10123`。 > > 再把數列剖半一次,找到 `8879`。 噫!好誒!我中了! > > **找尋步數:2** > ::: > :::danger > ### 一個一個去找 > 單純從頭開始找 > > **尋找步數:8** > ::: >> ### 範例子區段1 >> 內容 > >> ### 範例子區段2 >> 內容 ## 程式碼格式 要記得第一行要打對 ` ```python=` ```python= def bubbleSort(arr): -> list arrCopy = arr.copy() for i in range(len(arrCopy)): for j in range(len(arrCopy)-1): if (arrCopy[j]>arrCopy[j+1]): arrCopy[j], arrCopy[j+1] = arrCopy[j+1], arrCopy[j] return arrCopy ``` ```python=8 arr = [3,2,1] print(bubbleSort(arr)) ``` ### 輸出example1 **Output |** `hello world` ### 輸出example2 > **Output** > ``` > hello world > ``` ### 加註方式 要加上這個->(點我展開) :::spoiler **註**(點我展開) 1. 演算法 == 解決問題的方法 2. 我們在評估程式時間時,要評估的是程式最大的執行時間。這是因為有些噁心的程式題目都會用很噁心的測資,讓你程式跑超久。就連海塔都噁心到了! :::
×
Sign in
Email
Password
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