Question 1: What are the criteria for this program?
Question 2: Does such a number exist? What is the minimum number that meets this condition?
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).
- Question 4: How can I improve the efficiency of this program on multi-core computers?
(Note: This program is written in C # language, but as long as there is no reading pressure on the basis of C language, if you do not understand some of the statements, please check yourself)
usingSystem;usingSystem.Collections.Generic;usingSystem.Text;namespacefindthenumber{classProgram {Static voidMain (string[] args) {int[] RG ={2,3,4,5,6,7,8,9,Ten, One, A, -, -, the, -, -, -, +, -, +, A, at, -, -, -, -, -, in, -, to}; for(Int64 i =1; i < Int64.maxvalue; i++) {intHit =0; intHit1 =-1; intHit2 =-1; for(intj =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); } }}}
To read the following procedure, please answer the following questions: