#include <iostream>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
srand(time(0)); // Инициализация генератора случайных чисел
const double C = 2.5; // Константа
double M[6][6];
// Заполнение матрицы случайными числами от 1 до 10
for(int i = 0; i < 6; i++) {
for(int j = 0; j < 6; j++) {
M[i][j] = rand() % 10 + 1;
}
}
// Вывод матрицы
cout << "Матрица M (6x6):" << endl;
for(int i = 0; i < 6; i++) {
for(int j = 0; j < 6; j++) {
cout << setw(4) << M[i][j] << " ";
}
cout << endl;
}
// Вычисление произведения элементов главной диагонали
double product = 1.0;
cout << "\nЭлементы главной диагонали: ";
for(int i = 0; i < 6; i++) {
cout << M[i][i] << " ";
product *= M[i][i];
}
cout << "\n\nПроизведение элементов главной диагонали: " << product << endl;
cout << "Константа C: " << C << endl;
cout << "Результат (произведение * C): " << product * C << endl;
return 0;
}