ПО ФИЗКУЛЬТУРЕ ОТВЕТИТЬ Занятие бодибилдингом развивают преимущественно:
а) силовые
б) скоростные качества
в) общую выносливость
г) ловкость
Ответы на вопрос:
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
const int SIZE = 5;
void fillAndShowArray(int[][SIZE], const int size);
int findMinElement(int[][SIZE], const int size);
int findMaxElement(int[][SIZE], const int size);
int main()
{
setlocale(LC_ALL, "rus");
int matrix[SIZE][SIZE] = {};
fillAndShowArray(matrix, SIZE); //заполняем и показываем массив
cout << endl;
cout << "Минимум: " << findMinElement(matrix, SIZE) << endl;
cout << "Максимум: " << findMaxElement(matrix, SIZE) << endl;
return 0;
}
void fillAndShowArray(int arr[][SIZE], const int size)
{
for (int i = 0; i < size; i++)
{
cout << "| ";
for (int j = 0; j < size; j++)
{
arr[i][j] = 30 + rand() % 31;
cout << arr[i][j] << " ";
}
cout << " |" << endl;
}
}
int findMinElement(int arr[][SIZE], const int size)
{
int min = arr[0][0];
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
if (arr[i][j] < min)
min = arr[i][j];
}
}
return min;
}
int findMaxElement(int arr[][SIZE], const int size)
{
int max = arr[0][0];
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
if (arr[i][j] > max)
max = arr[i][j];
}
}
return max;
}
Популярно: Другие предметы
-
Elka2967719.01.2020 01:10
-
nikolaenko047310.01.2022 19:21
-
maks73726.10.2021 09:07
-
konobeevvlad20.03.2021 15:10
-
liliya07017.04.2022 11:48
-
Igorkhvan21.03.2023 03:55
-
Irby20.04.2020 22:56
-
Alesha211221.10.2022 17:35
-
olgamarinina124.01.2020 18:49
-
Alrksanr15.12.2020 00:20