#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;
}
и вместо последних 9-ти строк твоей программы должно быть:
{заполняем массив b минимальными элементами каждой строки}
for i := 1 to 5 do
begin
for j := 1 to 5 do if a[i,j] < b[i] then b[i] := a[i,j];
Write(b[i], ' ')
end;
WriteLn;
{сортируем массив b}
for i := 1 to 4 do
for i+1 := 1 to 5 do
if b[i] < b[j] then
begin
c := b[i];
b[i] := b[j];
b[j] := c
end;
{выводим отсортированный массив на экран}
for i := i to 5 do Write(b[i], ' ');
WriteLn
END.