|
|
back to boardReverse Root 1001 Runtime error C# Posted by Blaine 31 Dec 2014 08:08 I cant figure out how the code receives the input data, if anyone could shed some light on how to fix my code that would be very much appreciated. using System; using System.Collections.Generic; class Program { static void Main() { var rootList = new List<string>();
string aLine = Console.In.ReadToEnd();
string[] separators = {" "};
var arguments = aLine.Split(separators , StringSplitOptions.RemoveEmptyEntries); foreach (var arg in arguments) {
rootList.Add(Math.Sqrt(long.Parse(arg)).ToString("#.####"));
} rootList.Reverse();
foreach(string root in rootList) { Console.WriteLine(root);
}
} } |
|
|