--- title: 16-3:公倍數 lang: zh-tw tags: DICE Python --- 16-3:公倍數 === > [name=Chinglin-K] --- 目錄:[Dice 程式教學-Python完整版](https://hackmd.io/@Chinglin-K/Dice-menu) 上一篇:[16-2:倍數](https://hackmd.io/@Chinglin-K/Dice-16-2) 下一篇:[16-4:因數](https://hackmd.io/@Chinglin-K/Dice-16-4) --- ## 題目 請撰寫一程式,輸入三個整數(小於1000),找出小於等於1000的所有公倍數。 輸入範例: 30 45 18 輸出範例: 90 180 270 360 450 540 630 720 810 900 990 --- ## 程式碼 ```Python= #a,b,c=map(int,input().split()) -> 題目打錯了 a=int(input()) b=int(input()) c=int(input()) t=1 while True: if(t>1000): break elif(t%a==0 and t%b==0 and t%c==0): print(t,end=" ") t=t+1 ``` --- ## 輸出 ```Python= ``` --- 目錄:[Dice 程式教學-Python完整版](https://hackmd.io/@Chinglin-K/Dice-menu) 上一篇:[16-2:倍數](https://hackmd.io/@Chinglin-K/Dice-16-2) 下一篇:[16-4:因數](https://hackmd.io/@Chinglin-K/Dice-16-4) --- :::info 「盡多少本分,得多少本事」😊 ::: --- {%hackmd i1nMRrZcTFmTvoF897K9zg %}
×
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