上一页 1 ··· 32 33 34 35 36
在网上看到的一个比较好的The 3n+1 problem,通过中间变量来保存结果集,较少了运算数量 1 #include <iostream> 2 3 #include <vector> 4 5 6 7 #define SIZE 100000 8 9 10 11 using namespace std;12 13 14 15 int Count(vector<int> &viRec, int iNum)16 17 {18 19 int iTemp=iNum, iResult=0;20 21 22 23 if (viRec[iTemp]!=0) ret Read More
posted @ 2012-06-03 14:43 godjob Views(213) Comments(0) Diggs(0) Edit
上一页 1 ··· 32 33 34 35 36