- 注册时间
- 2007-12-26
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 92615
- 在线时间
- 小时
|
发表于 2008-5-7 16:20:49
|
显示全部楼层
搜索代码
- // 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;
- }
复制代码 编译上述代码,运行 1.8s 即可输出符合要求的全部 736 组数据。 |
|