Using System;
Using System.Collections.Generic;
Using System.Text;
Namespace Findthenumber//here feels like C + +
{
Class Program
{
When the static void Main (string[] args)//c# declares an array, the square brackets ([]) must follow the type, not the identifier behind
This is the opposite of the C language.
{
int [] RG =//Initialize array
{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++)//int64 value types represent values ranging from 9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 The integer between.
{
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);
}
}
}
}
}
Question 1: What are the criteria for this program?
A: This is checked online: The Int64 value type represents an integer value between 9,223,372,036,854,775,808 and +9,223,372,036,854,775,807.
As for the procedure, I can't read it very well.
Question 2: Does such a number exist? What is the minimum number that meets this condition?
A: I personally think it should exist.
Question 3: How long do you expect to be able to output the first result when running this program on a computer? The time is accurate to minutes (computer: Single core CPU 4.0G Hz, memory and hard disk resources are sufficient).
A: I think it's quite a long time, about five minutes.
Question 4: How can I improve the efficiency of this program on multi-core computers?
A: Do it in several categories at the same time
"A blank" of C #