主要因素我寫了下面的C代碼,找出了大量的大底因子和我的程序在運行時保持執行forever.I試圖通過指定的2 iBigNum
withing範圍內進行調試^ 32-1,然後它的工作。查找C出大量
LONG64 iBigNum = 600851475143,iCurr=0,iLarge=0;
//600851475143
/*4294967295
4000000000
*/iCurr = iBigNum-1;
while(iCurr > 0)
{
if(iBigNum % iCurr == 0){
iLarge=iCurr;
break;
}
iCurr--;
}
MsgPrintf(TEXT("CustomPrint"),TEXT("%d"),iLarge);
之間,LONG64
被定義爲basetsd.h
//
// The following types are guaranteed to be signed and 64 bits wide.
//
typedef __int64 LONG64, *PLONG64;
我運行在Intel Core 2 Duo處理器的代碼爲3.16GHz運行具有4 GB RAM.Is這種預期的行爲?有人能指出我有些方向? 謝謝
注意:「%d」可能無法與「iBigNum」正常工作。 – chux
@chux感謝,將其改爲 「%LD」 – ZoomIn
推薦' 「%I64d號」'[_ _int64](http://msdn.microsoft.com/en-us/library/aa261215(V = vs.60)。 aspx)或http://stackoverflow.com/questions/3068088/how-to-write-int64-to-cstring – chux