|
|
back to boardWhere is the problem(1001 C#) using System; using System.Collections.Generic; using System.Text; using System.IO; namespace Timus1081 { class Program { static void Main(string[] args) { new Program().Run(Console.In, Console.Out); //new Program().Run(new StreamReader(@"d:\a.txt"), Console.Out); //Console.ReadLine(); } private void Run(System.IO.TextReader textReader, System.IO.TextWriter textWriter) { string[] ss = textReader.ReadToEnd().Split(); //string ss = input.Split('\n'); List<double> bs = new List<double>(); for (int i = 0; i < ss.Length; i++) { if (ss[i].Trim().Length > 0) { //string[] s1 = ss[i].Trim().Split(' '); //for (int j = 0; j < s1.Length; j++) { try { bs.Add(Math.Sqrt(Double.Parse(ss[i]))); } catch (Exception ex) { } } } }
for (int i = bs.Count - 1; i >= 0; i--) textWriter.WriteLine(bs[i].ToString("F4")); } } } |
|
|