var c, f, First, count:integer; begin write('c = '); readln(c); f := c; while (f div 10 > 0) do begin First := f div 10; count := 1; while (First div 10 > 0) do begin First := First div 10; Inc(count); end; if First <> f mod 10 then begin writeln('No'); readln; Exit; end;
while count > 0 do begin First := First * 10; dec(count); end; f := f - First; f := f div 10; end; writeln('Changeling'); readln; end.
var B:array[1..100, 1..100] of real; i, j, n:integer; Pr:real; flag:boolean; begin randomize; write('n = '); readln(n); if n < 2 then begin writeln('некорректный размер матрицы'); Exit; end;
for i := 1 to n do begin for j := 1 to n do begin B[i, j] := (random(101) - 50) / 10; write(B[i, j], ' '); end; writeln; end;
Pr := 1; flag := false; for i := 2 to n do for j := 1 to i - 1 do if B[i, j] < 0 then begin flag := true; Pr := Pr * B[i, j]; end; if Flag then writeln('Pr = ', Pr) else writeln('Нет ни одно отрицательного элемента ниже главной диагонали'); readln; end.
var
c, f, First, count:integer;
begin
write('c = ');
readln(c);
f := c;
while (f div 10 > 0) do
begin
First := f div 10;
count := 1;
while (First div 10 > 0) do
begin
First := First div 10;
Inc(count);
end;
if First <> f mod 10 then
begin
writeln('No');
readln;
Exit;
end;
while count > 0 do
begin
First := First * 10;
dec(count);
end;
f := f - First;
f := f div 10;
end;
writeln('Changeling');
readln;
end.
var
B:array[1..100, 1..100] of real;
i, j, n:integer;
Pr:real;
flag:boolean;
begin
randomize;
write('n = ');
readln(n);
if n < 2 then
begin
writeln('некорректный размер матрицы');
Exit;
end;
for i := 1 to n do
begin
for j := 1 to n do
begin
B[i, j] := (random(101) - 50) / 10;
write(B[i, j], ' ');
end;
writeln;
end;
Pr := 1;
flag := false;
for i := 2 to n do
for j := 1 to i - 1 do
if B[i, j] < 0 then
begin
flag := true;
Pr := Pr * B[i, j];
end;
if Flag then
writeln('Pr = ', Pr)
else
writeln('Нет ни одно отрицательного элемента ниже главной диагонали');
readln;
end.