Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 394 Bytes

真题.md

File metadata and controls

24 lines (18 loc) · 394 Bytes

蓝桥杯的真题

核桃的数量

  • map函数的用法
  • 定义函数去解决问题
  • 求最小公倍数
#输入一行数字,每个数字间带空格
a,b,c = map(int,input().split())

def zuixiao(a,b):
    n = min(a,b)
    while True:
        if n%a == 0 and n%b == 0:
            return n
            break
        n += 1
    

ans = zuixiao(c,zuixiao(a,b))
print(ans)