/
GapiGap
/
lesson_5.3
Обзор
Документация
Войти
/
GapiGap
/
lesson_5.3
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
main.cpp
50 строк
1 KB
GapiGap
upload files
21 май 2025, 12:04
21 май 2025, 12:04
89a9c5b
Код
Авторство
О чём код?
#include<iostream> #include<cstdlib> #include<ctime> #include<limits> int main() { setlocale(LC_ALL, "ru"); srand(time(NULL)); const int size = 3; const int sizeNumber = 6; int arrNumber[size][sizeNumber]; int max = std::numeric_limits<int>::min(); int min = std::numeric_limits<int>::max(); int indexSizeMax = 0; int indexSizeNumberMax = 0; int indexSizeMin = 0; int indexSizeNumberMin = 0; /*������ ? ? ? � ������� ������� ����� ������� ������������� � ������������ �������� ���������� ������� �� ���� �������� ��� ������� ����������� ��������� ���, �� �� ������� ����� ������ �������� �������*/ std::cout << "������:" << std::endl; for (int i = 0; i != size; ++i) { for (int j = 0; j != sizeNumber; ++j) { arrNumber[i][j] = rand() % 100 + 1; if (max <= arrNumber[i][j]) { max = arrNumber[i][j]; indexSizeMax = i; indexSizeNumberMax = j; } if (min > arrNumber[i][j]) { min = arrNumber[i][j]; indexSizeMin = i; indexSizeNumberMin = j; } std::cout << arrNumber[i][j] << "\t"; } std::cout << std::endl; } std::cout << "������� ������������� ��������: " << indexSizeMax << " "<<indexSizeNumberMax<<std::endl; std::cout << "������� ������������ ��������: " << indexSizeMin << " " << indexSizeNumberMin << std::endl; }