ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

1001 C# Can anyone explain why this is wrong?
Posted by Kris 9 Oct 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?
Posted by ToadMonster 9 Oct 2017 12:33
How many input lines are declared in the task?
How many input lines in the example?
How many lines your program expects?