[Глава 4] Упражнения 1-4

This commit is contained in:
Пытков Роман
2025-07-26 17:46:42 +03:00
parent 1f144231c0
commit 83d5f60fe9
8 changed files with 72 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
static class Task4_1
{
public static int Calculate(int[] arr, int index = 0)
{
if (index == arr.Length - 1)
return arr[index];
return arr[index] + Calculate(arr, index+1);
}
}