コード例 #1
0
        public void Solution()
        {
            int  idPrime    = 1;       //Id of prime number in sequence of prime numbers
            long prevNumber = number;  //Variable reciving value of _number to each iterration

            while (!number.IsPrime())
            {
                number = number % PrimeNumbers.GetElementAt(idPrime) == 0 ? number / PrimeNumbers.GetElementAt(idPrime) : number;
                idPrime++;
                if (prevNumber != number)
                {
                    prevNumber = number;
                    idPrime    = 1;
                }
            }
            largestFactor = number;
        }
コード例 #2
0
 public void Solution()
 {
     primeNumber = PrimeNumbers.GetElementAt(index);
 }