|
|
вернуться в форумneed clarifications on the posted solution using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { double i, j,a; double display=0; Console.WriteLine("enter the number:"); double n = double.Parse(Console.ReadLine()); try { for (i = 1; i <= n; i++) { for (j = 1; j <= n; j++) { if ((i * j) == n) { a = double.Parse(string.Concat((object)i, (object)j)); if (i == 1) { if (n == 1) display = 1; else display = a; } else { if (a < display) { display = a; } } } } } Console.WriteLine(display); } catch (NotFiniteNumberException) { Console.WriteLine(-1); } } } } Edited by author 01.02.2011 15:27 |
|
|