public static void Main()
Console.WriteLine("Enter function like 12x^2+5x-6");
String function = Console.ReadLine();
int[] numbers = parseFunction(function);
Console.WriteLine("Enter x");
int x = int.Parse(Console.ReadLine());
for (int i = 0; i<numbers.Length;i++)
Console.WriteLine("coef for x^" + (numbers.Length - i - 1) + " = " + numbers[i]);
int y = numbers[0] * x * x + numbers[1] * x + x;
Console.WriteLine("y = " + y);
private static int[] parseFunction(String function)
int[] numbers = new int[3];
for (int i=0; i< function.Length; i++)
} else if (Char.IsDigit(function[i]))
} else if (skip && function[i] == 'x')
numbers[k] = (sign) * int.Parse(str);
numbers[k] = (sign2) * int.Parse(str);