begin var n := ReadlnInteger('n = '); var m := ReadlnInteger('m = '); var rand := ReadlnInteger('Для ручного ввода нажмите 0');
if rand = 0 then begin a := new integer[m, n]; for var i := 0 to m-1 do for var j := 0 to n-1 do a[i, j] := ReadlnInteger('a[' + i + ',' + j + '] = '); end else a := MatrixRandom(m, n, 1, 100); Println(a);
var b := ArrGen(n, x -> 1); for var i := 0 to m-1 do for var j := 0 to n-1 do if j mod 2 = 0 then b[j] := b[j] * a[i, j];
b.Where((x, i)-> i mod 2 = 0).SortedDescending().Println(); end.
#include <iostream>
#include <vector>
using namespace std;
void solve(){
int m,n;
cin >> m >> n;
vector<vector<int>> a(m,vector<int>(n));
vector<bool> b(m, true);
for(int i = 0; i < m; i++)
for(int j = 0; j < n; j++)
cin >> a[i][j];
for(int i = 0; i < m; i++)
for(int j = 1; j < n; j++)
if(a[i][j] <= a[i][j-1])
b[i] = false;
for(auto i : b) cout << i << " ";
}
signed main(){
solve();
}
a: array [,] of integer;
begin
var n := ReadlnInteger('n = ');
var m := ReadlnInteger('m = ');
var rand := ReadlnInteger('Для ручного ввода нажмите 0');
if rand = 0 then begin
a := new integer[m, n];
for var i := 0 to m-1 do
for var j := 0 to n-1 do
a[i, j] := ReadlnInteger('a[' + i + ',' + j + '] = ');
end
else a := MatrixRandom(m, n, 1, 100);
Println(a);
var b := ArrGen(n, x -> 1);
for var i := 0 to m-1 do
for var j := 0 to n-1 do
if j mod 2 = 0 then
b[j] := b[j] * a[i, j];
b.Where((x, i)-> i mod 2 = 0).SortedDescending().Println();
end.