1)
Var
a:array[1..10] of integer;
i:integer;
begin
for i:=1 to 10 do
read(a[i]);
randomize;
a[i]:=random(136)+22;
if a[i]>100 then writeln(a[i]);
end.
2.
var
a,n:integer;
readln(a,n);
a:=a^n;
writeln(a);
end;
6.
x:array[1..5] of real;
for i:=1 to 5 do
read(x[i]);
if x[i]=9 then x[i]:=x[i]*3;
if x[i]>9 then x[i]:=x[i]/10;
writeln(x[i]);
Первая программа
const n=10;
var a,b:array[1..n] of integer;
i,j:integer;
for i:=1 to n do readln(a[i]);
for i:=1 to n do
writeln('a[',i,']=',a[i]);
for i:=n downto 1 do begin
for j:=n-i+1 to n do begin
b[j]:=a[i];
break;
writeln('b[',i,']=',b[i]);
Вторая программа
var i,s1,s2:integer;
a:array[1..n] of integer;
for i:=1 to n do begin
if(a[i] mod 2 = 0) then
s1:=s1 + a[i];
if(a[i] mod 2 <> 0) then
s2:=s2 + a[i];
writeln('Разность равна: ',s1-s2);
Третья программа
if(i mod 2 = 0) then
if(i mod 2 <> 0) then
1)
Var
a:array[1..10] of integer;
i:integer;
begin
for i:=1 to 10 do
read(a[i]);
randomize;
for i:=1 to 10 do
a[i]:=random(136)+22;
for i:=1 to 10 do
if a[i]>100 then writeln(a[i]);
end.
2.
var
a,n:integer;
begin
readln(a,n);
a:=a^n;
writeln(a);
end;
6.
var
x:array[1..5] of real;
i:integer;
begin
for i:=1 to 5 do
begin
read(x[i]);
if x[i]=9 then x[i]:=x[i]*3;
if x[i]>9 then x[i]:=x[i]/10;
writeln(x[i]);
end;
end.
Первая программа
const n=10;
var a,b:array[1..n] of integer;
i,j:integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do
writeln('a[',i,']=',a[i]);
for i:=n downto 1 do begin
for j:=n-i+1 to n do begin
b[j]:=a[i];
break;
end;
end;
for i:=1 to n do
writeln('b[',i,']=',b[i]);
end.
Вторая программа
const n=10;
var i,s1,s2:integer;
a:array[1..n] of integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do begin
if(a[i] mod 2 = 0) then
s1:=s1 + a[i];
if(a[i] mod 2 <> 0) then
s2:=s2 + a[i];
end;
writeln('Разность равна: ',s1-s2);
end.
Третья программа
const n=10;
var i,s1,s2:integer;
a:array[1..n] of integer;
begin
for i:=1 to n do readln(a[i]);
for i:=1 to n do begin
if(i mod 2 = 0) then
s1:=s1 + a[i];
if(i mod 2 <> 0) then
s2:=s2 + a[i];
end;
writeln('Разность равна: ',s1-s2);
end.