var a:array[1..5,1..5] of integer; i,j,m,n,min:integer; begin randomize; for i:=1 to 5 do begin for j:=1 to 5 do a[i,j]:=random(20); end; writeln('исходная мтарица'); for i:=1 to 5 do begin for j:=1 to 5 do write(a[i,j],' '); writeln; end; min:= a[5,5]; for i := 1 to 5 do for j := 1 to 5 do if i+j = n+1 then begin if a[i,j] < min then min:= a[i,j] else if j = 5 then if a[i, j - 1] < min then min:= a[i, j-1] else if i = 5 then if a[i - 1, j] < min then min:= a[i - 1, j] else if a[i, j - 1] < min then min:= a[i, j-1] else if a[i - 1, j] < min then min:= a[i - 1, j]; end; write(min); end.
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n;
cin >> n;
char* string1 = new char[n];
char* string2 = new char[n];
cin >> string1;
cin >> string2;
bool check = true;
if (strlen(string1) != strlen(string2))
cout << "Неверное количество символов";
else
{
for (size_t i = 0; i < round(strlen(string1) / 2); i++) {
if (string1[i] != string2[i]) {
check = false;
}
}
if (check)
cout << "Первые половины равны";
else
cout << "Половины первые не равны";
}
}