|
|
вернуться в форумWhy is wrong answer? Help me PLS! [C#] Here is my code: using System; using System.Collections; using System.IO; namespace problem1001 { class mySolution { static void Main() { Stream myStream = Console.OpenStandardInput(); Stack myNumbers = new Stack(); string buffer = ""; int temp; while (true) { temp = myStream.ReadByte(); if (char.IsDigit((char)temp)) buffer += (char)temp; else { if (buffer != "") { myNumbers.Push(double.Parse(buffer)); buffer = ""; } if (temp == -1) break; } } while (myNumbers.Count != 0) { Console.WriteLine("{0:f4}", Math.Sqrt((double)myNumbers.Pop())); } } } } |
|
|