标签:
这次阅读的是c#程序代码,由于没接触过,还查了查c#的使用。不过大致还是能看懂的。阅读代码如下:
using System;
using System.Collections.Generic;
using System.Text;
namespace FindTheNumber
{
class Program
{
static void Main(string[] args)
{
int [] rg =
{2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,
20,21,22,23,24,25,26,27,28,29,30,31};
for (Int64 i = 1; i < Int64.MaxValue; i++)
{
int hit = 0;
int hit1 = -1;
int hit2 = -1;
for (int j = 0; (j < rg.Length) && (hit <=2) ; j++)
{
if ((i % rg[j]) != 0)
{
hit++;
if (hit == 1)
{
hit1 = j;
}
else if (hit == 2)
{
hit2 = j;
}
else
break;
}
}
if ((hit == 2)&& (hit1+1==hit2))
{
Console.WriteLine("found {0}", i);
}
}
}
}
}
问题1:
找出一个数,不能被 2~31 中相邻的两个数整除,但可以被其余28个数整除。
问题2:
这个数是:23*33*52*7*11*13*19*23*29*31=2123581660200
问题3:
估算不出来,
问题4:
应该利用线程提高吧(电脑由原来的单核到多核到到多核多线程)。
标签:
原文地址:http://www.cnblogs.com/jingaaaaa/p/5561203.html