|
|
вернуться в форум1001 C# Can anyone explain why this is wrong? Послано Kris 9 окт 2017 04:08 Can anyone explain why this is saying wrong answer? namespace Ex2 { class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries); for (int a = input.Length - 1; a >= 0; a--) { double temp = Math.Sqrt(double.Parse(input[a])); if (temp == 0) { string zero = temp.ToString(); zero += ","; Console.WriteLine(zero.PadRight(6,'0')); } else { Console.WriteLine(temp); } } //Console.ReadLine(); } } } Re: 1001 C# Can anyone explain why this is wrong? How many input lines are declared in the task? How many input lines in the example? How many lines your program expects? |
|
|