Const
n = 5;
var
a,b : array [1..n] of integer;
i,s,k1,k2,max,min : integer;
begin
for i := 1 to n do
readln (a[i]);
for i := 1 to n do
writeln (i,')elem = ',a[i]);
end.
begin
for i := 1 to n do
a[i] := i * 3;
for i := 1 to n do
writeln (i,')elem = ',a[i]);
end.
begin
s := 0;
for i := 1 to n do
begin
readln (a[i]);
s := s + a[i];
end;
writeln (s);
end.
begin
k1 := 0;
k2 := 0;
for i := 1 to n do
begin
readln (a[i]);
if a[i] > 0 then
k1 := k1 +1;
if a[i] < 0 then
k2 := k2 +1;
end;
writeln ('+ ',k1);
writeln ('- ',k2);
end.
begin
k1 := 0;
k2 := 0;
for i := 1 to n do
begin
readln (a[i]);
if (a[i] > 0) and (i mod 2 = 1) then
k1 := k1 +1;
if (a[i] < 0) and (i mod 2 = 0) then
k2 := k2 +1;
end;
writeln ('+ ',k1);
writeln ('- ',k2);
end.
begin
for i := 1 to n do
begin
readln (a[i]);
if a[i] < 0 then
b[i] := sqr (a[i]);
if a[i] > 0 then
b[i] := a[i] * a[i] * a[i];
end;
for i := 1 to n do
write (a[i],' ');
writeln ();
for i := 1 to n do
write (b[i],' ');
end.
begin
for i := 1 to n do
readln (a[i]);
max := a[1]; min := a[1];
for i := 2 to n do
begin
if a[i] > max then
max := a[i];
if a[i] < min then
min := a[i];
end;
writeln ('max=',max);
writeln ('min=',min);
end.
begin
for i := 1 to n do
readln (a[i]);
writeln ('found :');
readln (s);
k1 := 0; k2 := 0;
for i := n downto 1 do
if a[i] = s then
begin
k1 := k1 + 1;
k2 := i;
end;
writeln ('k=',k1);
writeln ('i=',k2);
end.
Бери те переменные, которые используются в конкретной программме.