srand(time(0));
const int columns = 5;
const int lines = 5;
int A[lines][columns]{};
cout << "Massive A:" << endl;
for (int i = 0; i < lines; i++) {
}
int max = A[0][0];
int min = A[0][0];
for (int i = 0; i < lines; i++) {
}
cout << endl << "MAX: " << max << endl
system("pause");
const int columns = 5;
const int lines = 5;
int A[lines][columns]{};
cout << "Massive A:" << endl;
for (int i = 0; i < lines; i++) {
for (int j = 0; j < columns; j++) {
A[i][j] = rand() % 201-100;}
cout.width(4);
cout << A[i][j];
cout << endl;
}
int max = A[0][0];
int min = A[0][0];
for (int i = 0; i < lines; i++) {
for (int j = 0; j < columns; j++) {
if (max < A[i][j])}
max = A[i][j];if (min > A[i][j])
min = A[i][j];
cout << endl;
}
cout << endl << "MAX: " << max << endl
<< "MIN: " << min << endl;
system("pause");
Комментариев нет:
Отправить комментарий