Proszę o pomoc odnośnie poprawienia kodu bo już sam nie wiem jak go naprawić :/
Z góry bardzo dziękuje...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Consola_Horner_Rekurencyjnie
{
class Program
{
static void Main(string[] args)
{
int n;
Console.WriteLine("Podaj stopień wielomioanu: ");
n = Convert.ToInt32(Console.ReadLine());
int[] a = new int[n];
Console.WriteLine("Podaj wartosc a: ");
for (int i = 0; i <= n; i++)
{
Console.WriteLine("a [" + i);
a[i] = Convert.ToInt32(Console.ReadLine());
}
int x;
Console.WriteLine("Podaj x:");
x = Convert.ToInt32(Console.ReadLine());
int Horner(int i)
{
if (i == 0)
return a[0];
else
return Horner(i - 1) * x + a[i];
}
Console.WriteLine("Wynik to:" + Horner);
}
}
}