毕设一课通 从开题到答辩高效完成(含全栈项目)

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,"不是闰年")
复制代码
































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