Esempio n. 1
0
        private static void ViewResult(SearchPrimeFactors search, IntToString intToString, int digit)
        {
            try
            {
                intToString.FromIntToString(search.PrimeFactorProducts(search.PrimeFactorization(digit)));



                foreach (var item in intToString.FromIntToString(search.PrimeFactorProducts(search.PrimeFactorization(digit))))
                {
                    if (int.Parse(item) != digit)
                    {
                        Console.WriteLine(item);
                    }
                }
            }

            catch
            {
                Console.WriteLine("Вы ввели простое число.");
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            SearchPrimeFactors search = new SearchPrimeFactors();

            IntToString intToString = new IntToString();

            int digit = 0;

            Console.Write("Input Digit: ");

            try
            {
                digit = int.Parse(Console.ReadLine());

                ViewResult(search, intToString, digit);

                Console.WriteLine("\nГотово.");
            }
            catch
            {
                Console.WriteLine("Проверьте правильность введенных данных.");
            }
        }