16-7 最大公因數 - HackMD
文章推薦指數: 80 %
DICE C語言程式破解=== > [name=CHAWTeam] [time=Jun, 2020] :::danger 責任聲明: 本文章筆記僅提供程式解題說明攻略,純粹分享個人心得與想法.
DICEC語言程式破解
===
>[name=CHAWTeam][time=Jun,2020]
:::danger
責任聲明:
本文章筆記僅提供程式解題說明攻略,純粹分享個人心得與想法。
題目、輸出範例與範例程式均屬「[十八豆教育科技有限公司](http://www.18dice.tw)」旗下教學平臺「[DICE程式設計精準教學平台](http://www.18dice.tw/diceweb)」版權所有。
:::
:::warning
筆記教學仍處編輯中。
如未標上題目名稱或重複代稱的連結,均屬於未公開發表的文章筆記,我們已經盡全力編撰與校稿中,請耐心等候我們的更新。
若有任何勘誤、建議或疑問,請聯繫:[[email protected]](mailto:[email protected])
:::
-[目錄](https://hackmd.io/@CHAWTeam/DiceC)
-[C語言教學-現代C語言小心得](https://hackmd.io/@Sm-anD2jSA-PISAICYtLxA/HJPpJjvw7)
程式語言
---
-[C語言](https://hackmd.io/@CHAWTeam/DiceC)
-[C++(編撰中)](h1ttps://hackmd.io/@CHAWTeam/DiceCpp)
-[Python(編撰中)](h1ttps://hackmd.io/@CHAWTeam/DicePy)
1.測試系統
---
-[1-1Hello,DICE](https://hackmd.io/@CHAWTeam/DiceC-1-1)
2.讓螢幕會做秀
---
-[2-1SayHello](https://hackmd.io/@CHAWTeam/DiceC-2-1)
-[2-2印三角形](https://hackmd.io/@CHAWTeam/DiceC-2-2)
-[2-3倒印三角形](https://hackmd.io/@CHAWTeam/DiceC-2-3)
-[2-4不是計算](https://hackmd.io/@CHAWTeam/DiceC-2-4)
-[2-5來個表格](https://hackmd.io/@CHAWTeam/DiceC-2-5)
-[2-6身高體重](https://hackmd.io/@CHAWTeam/DiceC-2-6)
3.資料也有家
---
-[3-1印出指定的整數](https://hackmd.io/@CHAWTeam/DiceC-3-1)
-[3-2加上一些形容詞](https://hackmd.io/@CHAWTeam/DiceC-3-2)
-[3-3印出2個指定的整數](https://hackmd.io/@CHAWTeam/DiceC-3-3)
-[3-4印出指定的浮點數](https://hackmd.io/@CHAWTeam/DiceC-3-4)
-[3-5身高與體重](https://hackmd.io/@CHAWTeam/DiceC-3-5)
-[3-6最後來的是主人](https://hackmd.io/@CHAWTeam/DiceC-3-6)
-[3-7最後的結果是?](https://hackmd.io/@CHAWTeam/DiceC-3-7)
-[3-8自主學習](https://hackmd.io/@CHAWTeam/DiceC-3-8)
4.用電腦玩加法
---
-[4-1數蘋果](https://hackmd.io/@CHAWTeam/DiceC-4-1)
-[4-2=不是等號](https://hackmd.io/@CHAWTeam/DiceC-4-2)
-[4-3加法再現](https://hackmd.io/@CHAWTeam/DiceC-4-3)
-[4-4四捨五入](https://hackmd.io/@CHAWTeam/DiceC-4-4)
-[4-5計算一下](https://hackmd.io/@CHAWTeam/DiceC-4-5)
-[4-6自主學習](https://hackmd.io/@CHAWTeam/DiceC-4-6)
5.給什麼印什麼
---
-[5-1輸入1個整數](https://hackmd.io/@CHAWTeam/DiceC-5-1)
-[5-2輸入2個整數](https://hackmd.io/@CHAWTeam/DiceC-5-2)
-[5-3兩整數相加](https://hackmd.io/@CHAWTeam/DiceC-5-3)
-[5-4浮點數](https://hackmd.io/@CHAWTeam/DiceC-5-4)
-[5-53個浮點數](https://hackmd.io/@CHAWTeam/DiceC-5-5)
-[5-6身高與體重](https://hackmd.io/@CHAWTeam/DiceC-5-6)
-[5-7倒序](https://hackmd.io/@CHAWTeam/DiceC-5-7)
-[5-8長方形](https://hackmd.io/@CHAWTeam/DiceC-5-8)
-[5-9印出資料](https://hackmd.io/@CHAWTeam/DiceC-5-9)
-[5-10自主學習](https://hackmd.io/@CHAWTeam/DiceC-5-10)
6.加減乘除取餘數
---
-[6-1四則運算](https://hackmd.io/@CHAWTeam/DiceC-6-1)
-[6-2梯形面積](https://hackmd.io/@CHAWTeam/DiceC-6-2)
-[6-3溫度換算](https://hackmd.io/@CHAWTeam/DiceC-6-3)
-[6-4時間計算](https://hackmd.io/@CHAWTeam/DiceC-6-4)
-[6-5緞帶長度](https://hackmd.io/@CHAWTeam/DiceC-6-5)
-[6-6年利率](https://hackmd.io/@CHAWTeam/DiceC-6-6)
-[6-7圓周長與面積](https://hackmd.io/@CHAWTeam/DiceC-6-7)
-[6-8衛星繞地球](https://hackmd.io/@CHAWTeam/DiceC-6-8)
-[6-9製作時間](https://hackmd.io/@CHAWTeam/DiceC-6-9)
-[6-10自主學習](https://hackmd.io/@CHAWTeam/DiceC-6-10)
7.只選我要的
---
-[7-1選正數](https://hackmd.io/@CHAWTeam/DiceC-7-1)
-[7-2選偶數](https://hackmd.io/@CHAWTeam/DiceC-7-2)
-[7-3發現不相等](https://hackmd.io/@CHAWTeam/DiceC-7-3)
-[7-4輸出絕對值](https://hackmd.io/@CHAWTeam/DiceC-7-4)
-[7-5預算夠不夠?](https://hackmd.io/@CHAWTeam/DiceC-7-5)
8.if的妙用
---
-[8-1比大小](https://hackmd.io/@CHAWTeam/DiceC-8-1)
-[8-2三數比大小](https://hackmd.io/@CHAWTeam/DiceC-8-2)
-[8-3五數比大小](https://hackmd.io/@CHAWTeam/DiceC-8-3)
-[8-4判斷閏年](https://hackmd.io/@CHAWTeam/DiceC-8-4)
9.else魔法
---
-[9-1奇數還是偶數?](https://hackmd.io/@CHAWTeam/DiceC-9-1)
-[9-2是否能構成三角形?](https://hackmd.io/@CHAWTeam/DiceC-9-2)
-[9-3是否直角三角形?](https://hackmd.io/@CHAWTeam/DiceC-9-3)
-[9-4是否與7相關?](https://hackmd.io/@CHAWTeam/DiceC-9-4)
-[9-5是否為3的倍數-1?](https://hackmd.io/@CHAWTeam/DiceC-9-5)
-[9-6是否為3的倍數-2?](https://hackmd.io/@CHAWTeam/DiceC-9-6)
-[9-7是否為迴文?](https://hackmd.io/@CHAWTeam/DiceC-9-7)
-[9-8簡易分數查詢](https://hackmd.io/@CHAWTeam/DiceC-9-8)
10.比較中有比較
---
-[10-1分數等第](https://hackmd.io/@CHAWTeam/DiceC-10-1)
-[10-2正三角形嗎?](https://hackmd.io/@CHAWTeam/DiceC-10-2)
-[10-3玩玩二分法](https://hackmd.io/@CHAWTeam/DiceC-10-3)
-[10-4英文大小寫](https://hackmd.io/@CHAWTeam/DiceC-10-4)
11.多選一
---
-[11-1分數等第](https://hackmd.io/@CHAWTeam/DiceC-11-1)
-[11-2年齡說](https://hackmd.io/@CHAWTeam/DiceC-11-2)
-[11-3薪資計算](https://hackmd.io/@CHAWTeam/DiceC-11-3)
-[11-4月份判斷](https://hackmd.io/@CHAWTeam/DiceC-11-4)
-[11-5三角形型別](https://hackmd.io/@CHAWTeam/DiceC-11-5)
-[11-6BMI-1](https://hackmd.io/@CHAWTeam/DiceC-11-6)
-[11-7BMI-2](https://hackmd.io/@CHAWTeam/DiceC-11-7)
-[11-8BMI-3](https://hackmd.io/@CHAWTeam/DiceC-11-8)
-[11-93N+1-2](https://hackmd.io/@CHAWTeam/DiceC-11-9)
-[11-10判斷閏年](https://hackmd.io/@CHAWTeam/DiceC-11-10)
12.讓選擇更完美
---
-[12-1字元](https://hackmd.io/@CHAWTeam/DiceC-12-1)
-[12-2點套餐](https://hackmd.io/@CHAWTeam/DiceC-12-2)
-[12-3點食物](https://hackmd.io/@CHAWTeam/DiceC-12-3)
-[12-4運算](https://hackmd.io/@CHAWTeam/DiceC-12-4)
-[12-5運算列表](https://hackmd.io/@CHAWTeam/DiceC-12-5)
-[12-6計算機](https://hackmd.io/@CHAWTeam/DiceC-12-6)
13.直覺不結構的if...goto
---
-[13-1HaHaHa!笑他10次](https://hackmd.io/@CHAWTeam/DiceC-13-1)
-[13-2HaHaHa!笑他幾次](https://hackmd.io/@CHAWTeam/DiceC-13-2)
-[13-3月份判斷](https://hackmd.io/@CHAWTeam/DiceC-13-3)
-[13-4遞增?遞減?](https://hackmd.io/@CHAWTeam/DiceC-13-4)
14.我說幾遍就幾遍
---
-[14-1HaHaHa!笑他10次](https://hackmd.io/@CHAWTeam/DiceC-14-1)
-[14-2HaHaHa!笑他幾次](https://hackmd.io/@CHAWTeam/DiceC-14-2)
-[14-31印到100](https://hackmd.io/@CHAWTeam/DiceC-14-3)
-[14-41到100的偶數](https://hackmd.io/@CHAWTeam/DiceC-14-4)
-[14-51到100的和](https://hackmd.io/@CHAWTeam/DiceC-14-5)
-[14-61到N的和](https://hackmd.io/@CHAWTeam/DiceC-14-6)
-[14-710個數平均](https://hackmd.io/@CHAWTeam/DiceC-14-7)
-[14-8輸入整數](https://hackmd.io/@CHAWTeam/DiceC-14-8)
-[14-9計算總和](https://hackmd.io/@CHAWTeam/DiceC-14-9)
-[14-10計算平均](https://hackmd.io/@CHAWTeam/DiceC-14-10)
-[14-11質數?](https://hackmd.io/@CHAWTeam/DiceC-14-11)
15.做到我說停
---
-[15-1笑到我說停](https://hackmd.io/@CHAWTeam/DiceC-15-1)
-[15-2直到我說停](https://hackmd.io/@CHAWTeam/DiceC-15-2)
-[15-3到底迴圈幾次](https://hackmd.io/@CHAWTeam/DiceC-15-3)
-[15-4班級均分-總和](https://hackmd.io/@CHAWTeam/DiceC-15-4)
-[15-5班級均分-完成](https://hackmd.io/@CHAWTeam/DiceC-15-5)
-[15-6相反數絕對值](https://hackmd.io/@CHAWTeam/DiceC-15-6)
16.if是while的好幫手
---
-[16-130內6的倍數](https://hackmd.io/@CHAWTeam/DiceC-16-1)
-[16-2非6的倍數](https://hackmd.io/@CHAWTeam/DiceC-16-2)
-[16-3是3不是5的倍數](https://hackmd.io/@CHAWTeam/DiceC-16-3)
-[16-4倍數](https://hackmd.io/@CHAWTeam/DiceC-16-4)
-[16-5與7相關](https://hackmd.io/@CHAWTeam/DiceC-16-5)
-[16-6因數](https://hackmd.io/@CHAWTeam/DiceC-16-6)
-[16-7最大公因數](https://hackmd.io/@CHAWTeam/DiceC-16-7)
-[16-8公倍數](https://hackmd.io/@CHAWTeam/DiceC-16-8)
-[16-9更多的三角形](https://hackmd.io/@CHAWTeam/DiceC-16-9)
-[16-10互質](https://hackmd.io/@CHAWTeam/DiceC-16-10)
-[16-11GG了啦!](https://hackmd.io/@CHAWTeam/DiceC-16-11)
17.while與for本是一家親
---
-[17-11到100和](https://hackmd.io/@CHAWTeam/DiceC-17-1)
-[17-2奇數和](https://hackmd.io/@CHAWTeam/DiceC-17-2)
-[17-3偶數和](https://hackmd.io/@CHAWTeam/DiceC-17-3)
-[17-41到N之和](https://hackmd.io/@CHAWTeam/DiceC-17-4)
-[17-5X到Y之和](https://hackmd.io/@CHAWTeam/DiceC-17-5)
-[17-65的倍數不加](https://hackmd.io/@CHAWTeam/DiceC-17-6)
-[17-7細菌分裂](https://hackmd.io/@CHAWTeam/DiceC-17-7)
-[17-8等比級數公式](https://hackmd.io/@CHAWTeam/DiceC-17-8)
-[17-9遞減值](https://hackmd.io/@CHAWTeam/DiceC-17-9)
-[17-102的次方數](https://hackmd.io/@CHAWTeam/DiceC-17-10)
-[17-11冒牌費氏數列](https://hackmd.io/@CHAWTeam/DiceC-17-11)
18.迴圈中有迴圈
---
-[18-1九九乘法](https://hackmd.io/@CHAWTeam/DiceC-18-1)
-
19.玩玩迴圈-1
---
-
20.玩玩迴圈-2
---
-
21.呼叫數學專家 22.做大事的方法
---
-
23.自己呼叫相似的自己
---
-
24.數字排山倒海而來
---
-
25.一堆文字湊熱鬧
---
-
26.字元數字本一家
---
-
27.二維陣列 28.排序演算法
---
-
29.搜尋演算法
---
-
30.UVa-1
---
-
31.UVa-2
---
-
32.APCS-105-1
---
-
33.APCS-105-2
---
-
34.APCS-106-1
---
-
35.APCS-106-2
---
-
{%hackmdIiu5mOixR7yWkPHKCkabBg%}
延伸文章資訊
- 1遞迴/迴圈求解最大公因數
3. 33 / 9 = 3 餘6 4. 9 / 6 = 1 餘3 5. 6 / 3 = 2 餘0,除數3 即可為最大公因數 由以上敘述可得遞迴function:(了解原理後,寫出程式就不是問題)...
- 2最大公因數( 多個數字) - Python 教學
「最大公因數」也稱作「最大公約數」,表示能夠「整除多個整數的最大正整數」,例如12、24、48 這三個數字的最大公因數是12,又 ... 按照最大公因數的原理,編輯程式。
- 3輾轉相除法| C++與演算法
輾轉相除法(Euclidean algorithm) ... 輾轉相除法是歷史上最著名的演算法之一,是求兩數的最大公因數(GCD) 極快速的方法。 ... 原理是兩個數字互相減來減去,最後就會剩...
- 4a024. 最大公因數(GCD) - 高中生程式解題系統
給定兩個整數,請求出它們的最大公因數. 輸入說明. 輸入包含兩個整數,以空白鍵隔開,兩個整數均大於0, 小於231. 輸出說明. 輸出兩個整數的最大公因數. 範例輸入 #1.
- 5最大公因數- 維基百科,自由的百科全書
程式代碼