| 
注册时间2007-12-26最后登录1970-1-1威望 星金币 枚贡献 分经验 点鲜花 朵魅力 点上传 次下载 次积分92885在线时间 小时 
 | 
 
 发表于 2008-5-7 16:20:49
|
显示全部楼层 
搜索代码| 编译上述代码,运行 1.8s 即可输出符合要求的全部 736 组数据。复制代码// HugeCalcDemo.cpp : Defines the entry point for the console application.
//
//    Project -> Setting -> C/C++ -> Code Generation --> Use run-time library:
//        Win32 Debug:    Debug Multithreaded DLL
//        Win32 Release:    Multithreaded DLL
#include <iostream.h>
#include "../../../HugeCalc_API/CppAPI/Include/HugeCalc.h"  // 公共接口
#include "../../../HugeCalc_API/CppAPI/Include/HugeInt.h"	// 10进制系统
#include "../../../HugeCalc_API/CppAPI/Include/HugeIntX.h"	// 16进制系统
#pragma message( "automatic link to ../../../HugeCalc_API/CppAPI/Lib/HugeCalc.lib" )
#pragma comment( lib, "../../../HugeCalc_API/CppAPI/Lib/HugeCalc.lib" )
int main(int argc, char* argv[])
{
//  printf("Hello World!\n");
    CHugeIntX hugeTest;
    CHugeIntX hugeXor;
    UINT32 x, y, count = 0;
    cout << "Call " << HugeCalc::GetVer() << endl << endl;
	if ( HC_LICENSE_NONE == HugeCalc::GetLicenseLevel())
	{
		cout << endl << "警告:您未通过 HugeCalc.dll 的许可认证!" \
			<< endl << endl << "解决方案可选下列方案之一:" \
			<< endl <<	"    一、请将本程序移动到“/CopyrightByGuoXianqiang/[../]”目录下运行;" \
			<< endl <<	"    二、或请在 HugeCalc.chm 中进行注册(一劳永逸)。" \
			<< endl << endl;
		system( "pause" );
		return (-1);
	}
	HugeCalc::EnableTimer();
	HugeCalc::ResetTimer();
	for ( y=2; y<=256; ++y )
	{
		++(( hugeTest = 1 ) <<= y );
		for ( x=2, hugeXor=4; x<y; ++x, hugeXor <<= 1 )
		{
			if (( hugeTest ^= hugeXor ).IsPrime())
			{
				cout << HugeCalc::GetTimerStr( FT_HHMMSS_ms ) << "\tNo." << ++count
					<< "\ty = " << y << "\tx = " << x << endl;
			}
			hugeTest ^= hugeXor;
		}
	}
    system( "pause" );
    return 0;
}
 | 
 |