Answer the question
In order to leave comments, you need to log in
Named argument specifications must appear in all specified fixed arguments. Where is the mistake?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp140
{
class Program
{
static int Combin2(int n, int k, ref int[,] chest)
{
// N => K => 0
if (chest[n, k] == 0)
{
if (n == k || k==0)
{
return 1;
}
return Combin2(n - 1, k, ref chest) + Combin2(n - 1, k - 1, ref chest);
}
else
{
return chest[n, k];
}
}
//
static void Main(string[] args)
{
int[,] chest = new int[20,20];
//эта строка вызывает ошибку
Combin2(n: 4, k: 2, ref chest);
}
}
}
Answer the question
In order to leave comments, you need to log in
// добавить chest
Combin2(n: 4, k: 2, chest: ref chest);
// либо не указывать имена
// Combin2(4, 2, ref chest);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question