#include <iostream>
#include<stdlib.h>
/*
В прямоугольной целочисельной матрице упорядочить элементы, которые размещены на главной диагонале по убыванию
*/
using namespace std;
int main() {
setlocale(LC_ALL,"rus");
cout << "Masiv do sortirovki "<< endl << endl;
int mas[5][5];
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
mas[i][j]=-10+rand()%90;
cout<<mas[i][j]<<" ";
}
cout << endl;
}
cout << endl << endl;
cout << "Masiv posle sortirovki "<< endl << endl;
/* сортировку тут нужно провести */
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
cout<<mas[i][j]<<" ";
}
cout << endl;
}
cout << endl << endl;
return 0;
сорри если не правильно.(
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
int main()
{
int a[12];
for(int i = 0; i < 12; i++)
{
a[i] = rand() % 21;
cout << a[i] << ' ';
}
cout << endl;
int temp;
for(int i = 0, j = 11; i < j; i++, j--)
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
for(int i = 0; i < 12; i++)
{
cout << a[i] << ' ';
}
cout << endl;
return 0;
}
ну и где вопрос ? в Ютуб есть куча видео посмотри