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);
}
}
}
}
}
This is a C # program, a bit do not understand, but in the big God told a few things do not know, finally a little understand what this program means. 1 at the beginning to see the time is likely to be a cycle of the search process, through constant conditions, constantly changing variables to achieve the function, but I seem to ignore a little thing, that the program should not be as simple as I imagined, after looking at the computer, it is complete cannot be consecutive two integers can not be divisible, This should be the meaning, by the change of hit value to achieve. 2 I initially thought can written calculation out, should 10 cretin can obtain the calculation result, but I was wrong, this number is very big, I calculate for a long time did not calculate out. 3 I did not run on the computer, the specific results also do not know. 4 Use multicore, multiple CPUs, memory is large, and do not run other background programs on your computer. Very high frequency, using more bits of the operating system.
Read program Jobs