// PascalABC.NET 3.2, сборка 1488 от 21.06.2017
// Внимание! Если программа не работает, обновите версию!
№1
begin
var a:=ArrRandom(ReadInteger('n='),-5,5); a.Println;
Writeln('Количество различных злементов равно ',
a.Distinct.Count)
end.
Пример
n= 20
-1 -1 5 -3 0 5 5 -5 -2 -4 -1 -2 -2 -2 2 -2 -3 1 2 1
Количество различных злементов равно 9
№2
begin
var (m,n):=ReadInteger2('Количество строк и столбцов в массиве:');
Writeln('Вводите элементы построчно');
var t:=ReadMatrInteger(m,n).ElementsWithIndexes.MinBy(x->x[0]);
Writeln('Минимальный элемент A[',t[1]+1,',',t[2]+1,']=',t[0])
end.
Пример
Количество строк и столбцов в массиве: 3 4
Вводите элементы построчно
5 -11 0 9
12 7 -12 0
8 23 6 20
Минимальный элемент A[2,3]=-12
1)
var s1,s2,s3,s4:String;
var i:Integer;
begin
s4:= 'Иванов Иван Иванович';
i:=Pos(' ',s4);
s1:= Copy(s4,1,i);
Delete(s4,1,i);
i:=Pos(' ',s4);
s2:= Copy(s4,1,i);
Delete(s4,1,i);
s3:=s4;
WriteLn('s1 '+s1);
WriteLn('s2 '+s2);
WriteLn('s3 '+s3);
end.
2)
var s1,s2,s3,s4,s5:String;
var i:Integer;
begin
s4:= 'Иванов Иван Иванович';
i:=Pos(' ',s4);
s1:= Copy(s4,1,i);
Delete(s4,1,i);
i:=Pos(' ',s4);
s2:= Copy(s4,1,i);
Delete(s4,1,i);
s3:=s4;
s5:=s1+Copy(s2,1,1)+'.'+Copy(s3,1,1)+'.';
WriteLn(s5);
end.
Var x,y:integer;
begin
readln(x,y);
if (x<0) and (y>1) and (sqr(x)+sqr(y)>4) then writeln('A')
else if (x>0) and (y>1) and (sqr(x)+sqr(y)>4) and (y>x-2) then writeln('B')
else if (sqr(x)+sqr(y)<4) and (y>1) then writeln('C')
else if (x<-2) and (sqr(x)+sqr(y)>4) and (y>0) and (y<1) then writeln('D')
else if (sqr(x)+sqr(y)<4) and (x<0) and (y>0) and (y<1) then writeln('E')
else if (sqr(x)+sqr(y)<4) and (x>0) and (y>0) and (y<1) then writeln('F')
else if (sqr(x)+sqr(y)>4) and (y>0) and (y<1) and (x>2) and (y>x-2) then writeln('G')
else if (sqr(x)+sqr(y)>4) and (y>0) and (y<1) and (x>2) and (y<x-2) then writeln('H')
else if (sqr(x)+sqr(y)>4) and (x<0) and (y<0) and (y>x-2) then writeln('I')
else if (sqr(x)+sqr(y)<4) and (x<0) and (y<0) and (y>x-2) then writeln('J')
else if (sqr(x)+sqr(y)<4) and (x>0) and (y<0) and (y>x-2) then writeln('K')
else if (sqr(x)+sqr(y)<4) and (x>0) and (y<0) and (y<x-2) then writeln('L')
else if (sqr(x)+sqr(y)>4) and (x>0) and (y<0) and (y<x-2) then writeln('M')
else if (sqr(x)+sqr(y)<4) and (x<0) and (y<0) and (y<x-2) then writeln('N')
else if (y>1) and (y<x-2) then writeln ('O')
else writeln('Точка не лежит ни в одной из областей');
<span>end.</span>