public static void Main()
Console.WriteLine("Write binary number to be converted into decimal");
string input = Console.ReadLine().Trim();
if (!input.All(c => c == '0' || c == '1'))
Console.WriteLine("Syntax error: binary value must contain 0 and 1 only");
BigInteger result = input.Aggregate(BigInteger.Zero, (s, a) => s * 2 + a - '0');
Console.WriteLine("binary \"" + input + "\" == " + result);