srand(time(0));
const int size = 5;
int A[size][size]{};
for (size_t i = 0; i < size; i++) {
}
cout << endl << endl;
int min = A[0][0];
int index_min_x;
for (size_t i = 0; i < size; i++) {
}
for (size_t i = 0; i < size; i++) {
}
cout << "Result:" << endl;
for (size_t i = 0; i < size; i++) {
}
system("pause");
const int size = 5;
int A[size][size]{};
for (size_t i = 0; i < size; i++) {
for (size_t j = 0; j < size; j++) {
A[i][j] = rand() % 100;}
cout.width(3);
cout << A[i][j];
cout << endl;
}
cout << endl << endl;
int min = A[0][0];
int index_min_x;
for (size_t i = 0; i < size; i++) {
for (size_t j = 0; j < size; j++) {
if (min > A[i][j]) {}
min = A[i][j];}
index_min_x = i;
}
for (size_t i = 0; i < size; i++) {
for (size_t j = 0; j < size; j++) {
if (i == index_min_x) {}
int tmp = A[i][j];}
A[i][j] = A[size-1][j];
A[size - 1][j] = tmp;
}
cout << "Result:" << endl;
for (size_t i = 0; i < size; i++) {
for (size_t j = 0; j < size; j++) {
cout.width(3);}
cout << A[i][j];
cout << endl;
}
system("pause");
Комментариев нет:
Отправить комментарий