1)
var A: array [1..6,1..4] of integer;
i,j: integer;
begin
randomize;
for i := 1 to 6 do begin
for j := 1 to 4 do begin
A[i,j] := random(20) - 10;
end;
if (A[i,j] == 0) then begin
writeln("0 v stroke ", i);
continue;
end.
2)
var B: array [1..10] of integer;
i: integer;
for i := 1 to 10 do begin
if (i mod 2 == 0) then B[i] := 5;
else B[i] := 2;
writeln(B[i]);
program pr;uses crt;Var y,x:real;Begin Writeln('vvedite x'); readln(x); y:=(4*x)/(x-1); Writeln('y=',y:10:3); readln;end.
program pr;Var n,i,a:integer;BeginWriteln('введите кол-во цыфр');readln(n);for i:=1 to n do Beginreadln(a);if (a>9) and (a<1000) and (a mod 10=4) then Writeln(a);end;end.
2) использование массива
program pr;uses crt;Var n,i:integer; a:array[1..100] of integer;BeginWriteln('Введите кол-во цифр');readln(n);Writeln('Введите цифры');for i:=1 to n do read(a[i]);Writeln;for i:=1 to n doif (a[i]>9) and (a[i]<1000) and (a[i] mod 10=4) then Write(a[i],';');end.
1)
var A: array [1..6,1..4] of integer;
i,j: integer;
begin
randomize;
for i := 1 to 6 do begin
for j := 1 to 4 do begin
A[i,j] := random(20) - 10;
end;
end;
for i := 1 to 6 do begin
for j := 1 to 4 do begin
if (A[i,j] == 0) then begin
writeln("0 v stroke ", i);
continue;
end;
end;
end;
end.
2)
var B: array [1..10] of integer;
i: integer;
begin
for i := 1 to 10 do begin
if (i mod 2 == 0) then B[i] := 5;
else B[i] := 2;
end;
for i := 1 to 10 do begin
writeln(B[i]);
end;
end.
1)
program pr;
uses crt;
Var y,x:real;
Begin
Writeln('vvedite x');
readln(x);
y:=(4*x)/(x-1);
Writeln('y=',y:10:3);
readln;
end.
2)
program pr;
Var n,i,a:integer;
Begin
Writeln('введите кол-во цыфр');
readln(n);
for i:=1 to n do Begin
readln(a);
if (a>9) and (a<1000) and (a mod 10=4) then Writeln(a);
end;
end.
2) использование массива
program pr;
uses crt;
Var n,i:integer;
a:array[1..100] of integer;
Begin
Writeln('Введите кол-во цифр');
readln(n);
Writeln('Введите цифры');
for i:=1 to n do read(a[i]);
Writeln;
for i:=1 to n do
if (a[i]>9) and (a[i]<1000) and (a[i] mod 10=4) then Write(a[i],';');
end.