16-3:公倍數

Chinglin-K


目錄:Dice 程式教學-Python完整版
上一篇:16-2:倍數
下一篇:16-4:因數


題目

請撰寫一程式,輸入三個整數(小於1000),找出小於等於1000的所有公倍數。

輸入範例:
30 45 18
輸出範例:
90 180 270 360 450 540 630 720 810 900 990


程式碼

#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

輸出


目錄:Dice 程式教學-Python完整版
上一篇:16-2:倍數
下一篇:16-4:因數


「盡多少本分,得多少本事」😊