Const
m=5;
n=3;
var
i,j,k:integer;
a:array[1..m,1..n] of integer;
begin
Randomize;
Writeln('Исходный массив');
k:=0;
for i:=1 to m do begin
for j:=1 to n do begin
a[i,j]:=Random(999)+1;
Write(a[i,j]:4);
if (a[i,j] mod 8=0) and (a[i,j] mod 10=4) then Inc(k);
end;
Writeln
end;
if k>0 then begin
Writeln('Искомые элементы');
for i:=1 to m do
for j:=1 to n do
if (a[i,j] mod 8=0) and (a[i,j] mod 4=10) then Write(a[i,j],' ')
end
else
Writeln('Нет элементов, кратных 8 и оканчивающихся на 4')
end.
Пример работы программы
Исходный массив
424 672 826
546 587 413
507 211 884
252 781 518
750 656 359
Искомые элементы
424
var
a,b,c,d:real;
z,x:integer;
begin
z:=0;
x:=0;
readln(a);
readln(b);
readln(c):
readln(d);
if (b mod a)=0 then writeln('a делитель числа b');
if (с mod a)=0 then writeln('a делитель числа с');
if (в mod a)=0 then writeln('a делитель числа в');
if a>b then z:=z+1;
if b>c then z:=z+1;
if c>d then z:=z+1;
if z=3 then writeln('числа расположены по убыванию');
z:=0;
if a mod 5=0 then x:=x+1;
if a mod 7=0 then x:=x+1;
if x=2 then z:=z+1;
x:=0;
if b mod 5=0 then x:=x+1;
if b mod 7=0 then x:=x+1;
if x=2 then z:=z+1;
x:=0;
if c mod 5=0 then x:=x+1;
if c mod 7=0 then x:=x+1;
if x=2 then z:=z+1;
x:=0;
if d mod 5=0 then x:=x+1;
if d mod 7=0 then x:=x+1;
if x=2 then z:=z+1;
x:=0;
writeln(z,'чисел делятся на 5 и 7 ');
z:=0;
if a<=7 then z:=z+1;
if b<=7 then z:=z+1;
if c<=7 then z:=z+1;
if d<=7 then z:=z+1;
if z>0 then writeln('есть числа больше или равные 7')
end.
предпоследнее не могу прочесть задание, так что сорри.
Если используется 60 различных символов, то для кодирования одного символа требуется log(2)60 ≈ 6 бит
Для кодирование 50 символов нужно 50*6=300 бит
// PascalABC.NET 3.1, сборка 1174 от 22.02.2016
begin
var n:=ReadInteger('n=');
var a:=ArrRandomReal(n,1,50);
a.Println;
var m:=a.Min;
if m<>0 then
for var i:=0 to n-1 do a[i]/=m;
a.Println
end.
<u>Тестовые решения:</u>
n= 5
15.9562486982701 12.6295463515583 11.5262675264507 24.1544637978796 45.6158542677834
1.38433787534893 1.09571865502651 1 2.09560152429653 3.95755643907304
n= 10
14.0622929614327 16.5069398081428 13.2300360101415 45.449448110745 46.6062807271286 41.3808015088461 21.5502972461052 20.3082026570608 6.33108078377837 25.0892608808769
2.22115203417771 2.60728623941069 2.0896962875659 7.17878189569095 7.36150466545052 6.53613544386811 3.40388915922883 3.20769918290964 1 3.96287170196298
// PascalABC.NET 3.1, сборка 1174 от 22.02.2016
begin
var n:=ReadInteger('n=');
var a:=ArrRandom(n,1,50);
a.Println;
var m:=a.Max;
if m<>0 then
for var i:=0 to n-1 do a[i]+=m;
a.Println
end.
<u>Тестовые решения:</u>
n= 8
37 3 10 29 39 31 40 10
77 43 50 69 79 71 80 50
n= 10
9 47 40 19 20 37 21 39 26 31
56 94 87 66 67 84 68 86 73 78
<span>program amoeba; </span>
<span>var i,count:integer; </span>
<span>begin </span>
<span>i:=3; //количество часов </span>
<span>count:=1; //количество амеб </span>
<span>while i < = 24 do </span>
<span>begin </span>
<span>count:=count*2; //каждые 3 часа количество амеб удваивается </span>
<span>writeln(i,' hours: ',count); //выводим кол-во часов и амеб </span>
<span>i:=i+3; </span>
<span>end; </span>
<span>readln; </span>
<span>end.</span>