перепишите программу под pascal
using System;

namespace ConsoleApplication

{

class Class

{

static int [] Input ()

{

Console.WriteLine("введите размерность массива");

int n=int.Parse(Console.ReadLine());

int []a=new int[n];

for (int i = 0; i < n; ++i)

{

Console.Write("a[{0}]= ", i);

a[i]=int.Parse(Console.ReadLine());

}

return a;

}

static int Max(int[] a)

{

int max=a[0];

for (int i = 1; i < a.Length; ++i)

if (a[i] > max) max=a[i];

return max;

}

static void Main()

{

int[] myArray=Input();

int max=Max(myArray);

int kol=0;

for (int i=0; i
if (myArray[i]==max)++kol;

Console.WriteLine("Количество максимальных элементов = "+kol);

}

}

}

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.