C++ algorithm to calculate least common multiple for multiple numbers

后端 未结 15 1909
太阳男子
太阳男子 2020-12-14 16:29

Is there a C++ algorithm to calculate the least common multiple for multiple numbers, like lcm(3,6,12) or lcm(5,7,9,12)?

15条回答
  •  一整个雨季
    2020-12-14 17:22

    Not built in to the standard library. You need to either build it yourself or get a library that did it. I bet Boost has one...

提交回复
热议问题