首页
/
每日頭條
/
生活
/
python中兩個數最小公倍數
python中兩個數最小公倍數
更新时间:2026-02-12 17:05:39

題目内容: 輸入兩個正整數num1和num2(不超過500),求它們的最小公倍數并輸出。 我們定義求最小公倍數的函數為lcm,給出程序主體如下: num1=int(input("")) num2=int(input("")) print(lcm(num1,num2)) 請補充完成hcf函數的定義。 輸入格式:共兩行,每一行輸入一個不超過1000的正整數。 輸出格式:共一行,輸出一個正整數。 輸入樣例: 4 6 輸出樣例:12 時間限制:500ms内存限制:32000kb

python中兩個數最小公倍數(python3練習題100例四十五)1

python中兩個數最小公倍數(python3練習題100例四十五)2

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2026 - www.tftnews.com All Rights Reserved