// PascalABC.NET 3.1, сборка 1230 от 27.04.2016
procedure MatPrint(a:array[,] of integer);
begin
var maxcol:=Length(a,1)-1;
for var i:=0 to Length(a,0)-1 do begin
for var j:=0 to maxcol do Print(a[i,j]);
Writeln
end
end;
begin
var m:=ReadInteger('Кол-во строк:');
var n:=ReadInteger('Кол-во столбцов:');
var t:=MatrixRandom(m,n,10,99); // инициализация матрицы
MatPrint(t);
var a:=new real[n]; // массив для средних по столбцам
for var j:=0 to n-1 do begin
var s:=0;
for var i:=0 to m-1 do s+=t[i,j];
a[j]:=s/m
end;
// cортированная последовательность индексов столбцов
var ai:=a.Select((x,i)->Rec(x,i)).SortedDescending
.Select(x->x.Item2).ToArray;
// cоздаем промежуточный массив
var u:array[,] of integer; SetLength(u,m,n);
for var j:=0 to n-1 do
for var i:=0 to m-1 do u[i,j]:=t[i,ai[j]];
t:=Copy(u); // вернем назад данные в исходный массив
Writeln;
MatPrint(t);
end.
<u><em>Тестовое решение</em></u>
Кол-во строк: 5
Кол-во столбцов: 8
24 30 70 85 92 32 11 25
83 92 64 51 28 47 10 22
50 14 76 84 23 63 64 39
30 22 84 59 55 32 58 63
80 36 53 74 80 82 84 33
85 70 92 24 32 11 30 25
51 64 28 83 47 10 92 22
84 76 23 50 63 64 14 39
59 84 55 30 32 58 22 63
74 53 80 80 82 84 36 33
String a;
string b;
if (a.length() == b.length()) cout << "строки равны";
else
if (a.length() < b.length()) cout << a;
else cout << b;
38. 1 (*4) => 4 (*4)=> 16(-3) => 13(*4) => 52(-3) =>49
=> - команды
39. 5(+3)=>8(+3)=>11(^2)=>121(+3)=>124(+3)=> 127
40. 5(+1)=>6(^2)=>36(+1)=>37(+1)=>38(+1)=>39
<span>#include<span> <iostream>
</span>#include<span> <cstring>
</span>
int main() {
char* text1 = "Слово"<span>;
</span> char* text = "Как то текст с гласными на конце кок"<span>;
</span>
char* newText = new char[strlen(text)]<span>;
</span>
int lastStop = 0, lastIter = 0<span>;
</span> for (int i = 0; text[i] != '\0'; i++) {
bool copyIt = false<span>;
</span>
if (text[i] == ' ') lastStop = i<span>;
</span>
if (text[i + 1] == ' ' || text[i + 1] == '\0') {
for (int j = 0; text1[j] != '\0'; j++) {
if (text[i] == text1[j]) {
copyIt = false; break<span>;
</span> }
copyIt = true<span>;
</span> }
}
if (copyIt == true) {
for (int j = lastStop; j <= i; j++, lastIter++)
newText[lastIter] = text[j]<span>;
</span> }
}
for (int i = 0; i < lastIter; i++)
std::cout << newText[i]<span>;
</span>
std::cout << "\n"<span>;
</span>
return 0<span>;
</span>}</span>
Var a, b, rezultat: integer;
begin
writeln(`Введите значения a и b:`);
readln(a, b);
if a < b then
rezultat:=a*b
else
rezultat:=a*a-b*b
writeln(rezultat);
end.