jjzjj

c++ - "integer constant is too large for ‘long’ 求最大质因数时键入"

我正在解决Euler项目3:Description:Theprimefactorsof13195are5,7,13and29.Whatisthelargestprimefactorofthenumber600851475143?这是我生成答案的代码。但是我需要一个整数类型来保存600851475143。当我在Mac上的GCC上编译它时,我得到:integerconstantistoolargefor‘long’type".我预计longlong可以轻松持有这个数字。我也试过让它未签名。为什么我的代码不能保存这么小的数字?我该怎么做才能让它发挥作用?#include#includeusi