|
|
back to boardWhat's wrong in this? (C#) using System; namespace ConsoleApplication4 { class Program { static void SQRT(UInt64 sum) { double ima_ans = Convert.ToDouble(Math.Sqrt(Convert.ToDouble(sum))); Console.WriteLine(Convert.ToDouble((Math.Round(ima_ans = ima_ans * 10000)) / 10000)); } static void Main(string[] args) { string save_str=null; string str = Console.ReadLine(); int i = str.Length; int k; UInt64 sum; i = i - 1; while (i >= 0) { k = 0; while (i >= 0 && str[i] != ' ') { k = 1; save_str += str[i]; i = i - 1; } sum = Convert.ToUInt64(save_str); if (sum > 0 && sum <= Math.Pow(10, 18) || k == 1) SQRT(sum); save_str = null; i = i - 1; } Console.ReadLine(); } } } |
|
|