Const n=4; m=5;
var a:array[1..n,1..m] of integer;
i,j:integer;
begin
for i:=1 to n do
begin
for j:=1 to m do
begin
a[i,j]:=random(1000);
write(a[i,j]:4);
end;
writeln;
end;
for i:=1 to n do
for j:=1 to m do
if (a[i,j] mod 7=0)and(a[i,j]>99)and(a[i,j]<1000) then a[i,j]:=a[i,j]-10;
writeln('New:');
for i:=1 to n do
begin
for j:=1 to m do write(a[i,j]:4);
writeln;
end;
end.
Пример<span>889 188 17 186 772
394 121 406 679 936
20 147 868 691 450
525 73 575 232 416
New:
879 188 17 186 772
394 121 396 669 936
20 137 858 691 450
515 73 575 232 416
</span>
Пишу на QBasic
Допустим массив уже дан и заполнен
FOR I = 1 TO (Кол-во элементов массива)
IF A(I)=C THEN
X=X+1
END IF NEXT I
PRINT X
var a,b,c:integer;
s:real;
begin
writeln('Vvedite abc');
read(a,b,c);
s:=(a+b+c)/3;
writeln('Srednee arifmeticheskoe 3 chisel = ',s);
end.
begin
var r := ReadReal();
var S: Action2<real, real> :=
(percent, radius)-> Println(percent * Round(Pi, 2) * radius ** 2);
S(1, r);
S(0.3, r);
end.