ответ: Delphi/Pascal
program Matrix24;
var
a:array [1..10,1..10] of integer;
Max,M, N, i, j:Integer;
begin
Write('N: ');
Readln(N);
Write('M: ');
Readln(M);
for i:=1 to M do
writeln(i,': ');
for j:=1 to N do
Write(j,' : ');
Read(a[i,j]);
end;
writeln(j,': ');
Max:=a[1,j];
for i:=2 to M do
if a[i,j]>Max then Max:=a[i,j];
writeln('Масимальный элемент:',Max);
end
end.
#include <iostream>
#include <vector>
using namespace std;
void solve(){
int n;
cin >> n;
vector<char> s(n);
for(auto &i : s) cin >> i;
for(int i = 0; i < n - 1; i++){
for(int j = i + 1; j < n - 1; j++){
if(s[i] == s[i+1] && s[j] == s[j+1]){
cout << "Solution is: " << i + 1 << " " << j + 1;
return;
}
cout << "No solution";
signed main(){
solve();
ответ: Delphi/Pascal
program Matrix24;
var
a:array [1..10,1..10] of integer;
Max,M, N, i, j:Integer;
begin
Write('N: ');
Readln(N);
Write('M: ');
Readln(M);
for i:=1 to M do
begin
writeln(i,': ');
for j:=1 to N do
begin
Write(j,' : ');
Read(a[i,j]);
end;
end;
for j:=1 to N do
begin
writeln(j,': ');
Max:=a[1,j];
for i:=2 to M do
begin
if a[i,j]>Max then Max:=a[i,j];
end;
writeln('Масимальный элемент:',Max);
end;
end
program Matrix24;
var
a:array [1..10,1..10] of integer;
Max,M, N, i, j:Integer;
begin
Write('N: ');
Readln(N);
Write('M: ');
Readln(M);
for i:=1 to M do
begin
writeln(i,': ');
for j:=1 to N do
begin
Write(j,' : ');
Read(a[i,j]);
end;
end;
for j:=1 to N do
begin
writeln(j,': ');
Max:=a[1,j];
for i:=2 to M do
begin
if a[i,j]>Max then Max:=a[i,j];
end;
writeln('Масимальный элемент:',Max);
end;
end.
#include <iostream>
#include <vector>
using namespace std;
void solve(){
int n;
cin >> n;
vector<char> s(n);
for(auto &i : s) cin >> i;
for(int i = 0; i < n - 1; i++){
for(int j = i + 1; j < n - 1; j++){
if(s[i] == s[i+1] && s[j] == s[j+1]){
cout << "Solution is: " << i + 1 << " " << j + 1;
return;
}
}
}
cout << "No solution";
}
signed main(){
solve();
}