// PascalABC.NET 3.0, сборка 1088 function InitA(n:integer):array of integer; begin Result:=ArrRandom(n,-31,45) end;
procedure GetA(var a:array of integer); begin a:=InitA(ReadInteger('Количество элементов в массиве А: ')); end;
procedure PutM(c:char; a:array of integer); begin Writeln('*** Массив '+c+'[',a.Length,'] ***',#13#10,a); end;
function FormB(a:array of integer):array of integer; begin Result:=Range(0,a.Length-1,2).Select(x->a[x]).ToArray end;
function MinEl(a:array of integer):integer; begin Result:=a.Min end;
begin var mA:array of integer; GetA(mA); PutM('A',mA); var mB:=FormB(mA); PutM('B',mB); Writeln('Минимальный элемент в массиве В равен ',MinEl(mB)) end.
Тестовое решение: Количество элементов в массиве А: 15 *** Массив A[15] *** [-22,0,-9,17,14,3,38,-18,-28,-17,28,13,1,1,26] *** Массив B[8] *** [-22,-9,14,38,-28,28,1,26] Минимальный элемент в массиве В равен -28
sunrise
25.04.2020
#include<iostream> using namespace std; int main(){ setlocale( LC_ALL, "Russian" ); float M,K,S; int dp; cout << "Какие действие вы будете выполнять:" << endl; cout << "1. Сложение. " << endl; cout << "2. Отнимание." << endl; cout << "3. Умножение." << endl; cout << "Введите число для выбора действия" << endl; cin >> dp; switch(dp) { case 1: cout << "Число M = "; cin >>M; cout <<"Число K = "; cin >> K; S = M + K; cout << "\n"<<M<<"+"<<K<<"="<<S<<endl; break; case 2: cout <<"Число M = "; cin >> M; cout <<"Число K = "; cin >> K; S = M - K; cout <<"\n" << M <<"-"<<K<<"="<<S<<endl; break; case 3: cout <<"Число M = "; cin >> M; cout <<"Число K = "; cin >> K; S = M *K; cout <<"\n"<<M<<"*"<<K<<"="<<S<<endl; break; } system("pause"); return 0; }
64=2^i
i=6
K=8190/6=1365 символов