using System;
using static System.Console;
using System.Linq;
namespace ConsoleApp9
{
class Program
{
static void Main(string[] args)
{
Write("Введите размер массива: ");
int[] a = new int[int.Parse(ReadLine())];
WriteLine("Введите элементы массива: ");
WriteLine("наименьший четный элемент: "+
a.Select(x => x = int.Parse(ReadLine())).Where(x => Math.Abs(x) % 2 == 0).Min().ToString());
ReadKey();
}
}
}
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int n=4, m=5;
int a[n][m];
srand(time(0));
int s=0;
for(int i=0; i<n; i++)
{
for(int j=0; j<m; j++)
{
a[i][j]=-99+rand()%199;
cout << setw(4) <<a[i][j];
s+=a[i][j];
}
cout << endl;
}
float r=float(s)/(m*n);
int k=0;
for(int i=0; i<n; i++)
for(int j=0; j<m; j++)
if(a[i][j]>r)
k++;
cout << "k = " << k;
return 0;
}