畢設一課通 從開題到答辯高效完成(含全棧項目)

download:畢設一課通 從開題到答辯高效完成(含全棧項目)

專爲畢業生打造,助你高效、高質量完成畢設作品,解決畢業頭等大事。課程全面梳理畢設流程,並精準定位每個環節的重點難點、完成技巧,掃清畢設難題。採用主流、企業級技術棧,祝你完成畢設,直面校招。

適合人羣
計算機系大學生

技術儲備要求
HTML / CSS / JavaScript

1 a=int(input('輸入數字1:'))
2 b=int(input('輸入數字2:'))
3 s=a*b
4 while a%b!=0:
5 a,b=b,(a%b)
6 print(a)
7 print(b)
8 else:
9 print(b,'is the maximum common divisor最大條約數')
10 print(s//b,'is the least common multiple,最小公倍數')
複製代碼
更相減損法










複製代碼
1 a=int(input('please enter 1st num:'))
2 b=int(input('please enter 2nd num:'))
3 s=a*b
4
5 while a!=b:
6 if a>b:
7 a-=b
8 elif a<b:
9 b-=a
10 else:
11 print(a,'is the maximum common divisor')
12 print(s//a,'is the least common multiple')
13
14 #運轉結果
15 please enter 1st num:40
16 please enter 2nd num:60
17 20 is the maximum common divisor
18 120 is the least common multiple
複製代碼
5。判別能否爲閏年 (輾轉相除法)
複製代碼
1 # 判別能否爲閏年
2 while True:
3 try:
4 num=eval(input("請輸入一個年份:"))
5 except:
6 print('輸入錯誤年份')
7 continue
8 if (num %4==0 and num%100 !=0) or num %400==0:
9 print(num,"是閏年")
10 else:
11 print(num,"不是閏年")
複製代碼
































發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章