Read program Jobs

Source: Internet
Author: User

usingSystem;

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.