|
|
back to boardWhat is wrong (Runtime error)? - C# using System; class Program{ static void Main(){ string[] input = Console.ReadLine().Split(new char[]{' ', '\t', '\n'}, StringSplitOptions.RemoveEmptyEntries); string Result = ""; double temp; for (int i = 1; i <= Int32.Parse(input[0]); i++){ temp = Math.Sqrt(((Int32.Parse(input[i]) - 1) * 8) + 1); temp = (temp - 1) / 2; if (temp % 1 == 0) Result += "1 "; else Result += "0 "; } Console.WriteLine(Result); } } Edited by author 04.07.2015 10:47 |
|
|