0% found this document useful (0 votes)
24 views1 page

Pascal Eee

The document describes a program that reads in an array of integers, loops through the array from the last element to the first, and sums the elements, writing the running total. It then reads in a value to end the program.

Uploaded by

Kacpi330
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Pascal Eee

The document describes a program that reads in an array of integers, loops through the array from the last element to the first, and sums the elements, writing the running total. It then reads in a value to end the program.

Uploaded by

Kacpi330
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

begin

j:=0;
Readln(n);
for i:= 1 to n do
begin
Readln(suma[i]);
end;
for i:=n downto 1 do
begin
j:=j+suma[i];
Writeln(j);
end;
Readln(endo);
end. odwrotnie

program naprze;
var suma: array[1..300001] of Integer;
var a,j,i,n,b,c,endo,k: Longint;
begin
Readln(n);
a:=0;
for i:=1 to n do
begin
Readln(k);
for j:=1 to k do
begin
Readln(suma[j]);
end;
for j:=1 to k do
begin
if j mod 2=0 then writeln(suma[j]);
end;
for j:=1 to k do
if j mod 2 <> 0 then writeln(suma[j]);

end;
Readln(endo);
end.

You might also like