Answer the question
In order to leave comments, you need to log in
An exception of type 'System.StackOverflowException' was thrown. how to fix?
class Program
{
public static long Demo(int n, int x)
{ long k = 0;
n = 1;
int f = 0;
if (n != f)
k = k + (long)((Math.Pow(x, n - 1)) / (n - 1));
n++;
f++;
k = Demo(n, x);
return k;
}
static void Main()
{
Console.WriteLine("Введите n");
int n = int.Parse(Console.ReadLine());
Console.WriteLine("Введите х");
int x = int.Parse(Console.ReadLine());
<code></code>
Demo(n,x);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question