srand(time(0));
const int size = 5;
int A[size][size]{};
for (size_t i = 0; i < size; i++) {
}
cout << endl << endl;
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;
for (size_t i = 0; i < size; i++)
{
for (size_t j = 0; j < size; j++)
{
if (j > i) {}
int tmp = A[i][j];}
A[i][j] = A[j][i];
A[j][i] = 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");
Комментариев нет:
Отправить комментарий