using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static int my_function(int[] args)
{
int n = args.Length;
int i,k=0,index;
for (i = 0; i < n; i++)
{
index = i + 1; // таким образом нулевой элемент будем считать первым
if (args > 0)
{
k++;
args = args / index;
}
}
return k;
}
static void Main(string[] args)
{
int[] a = new int[] { 1, 6, 23, 7, 5, -3, 7, 5, 1, 0, 4, 44, 7, -3, 8, 5, 3 };
int[] b = new int[] { 5, 2, -3, 4, -9, 2, -55, 1, 6, 5, 3, 6, -8, 2, -4, 8, -4, -2346, 467, -456, 2, -3, 6, 8};
int aa, bb;
String msg = "Количество замен в массивах одинаково";
aa = my_function(a);
bb = my_function(b);
Console.WriteLine("Замен в массиве A: "+aa);
Console.WriteLine("Замен в массиве B: " + bb);
if (aa > bb) msg = "В массиве A замен больше, чем в массиве B";
if (aa < bb) msg = "В массиве B замен больше, чем в массиве A";
Console.WriteLine(msg);
Console.ReadKey();
}
}
}