Răspuns :
1.
var
A:array[1..100] of real;
i,n:integer;
s,p:real;
begin
read(n);
p:=1;
for i:=1 to n do
begin
read(a[i]);
s+=a[i];
p*=a[i];
end;
writeln(s);
writeln(p);
end.
2.
var
A:array[1..100] of real;
i,n:integer;
p:real;
begin
read(n);
p:=1;
for i:=1 to n do
begin
read(a[i]);
if(a[i]>0) then
p*=a[i];
end;
writeln(p);
end.
3.
var
X:array[1..100] of integer;
i,n,s,p:integer;
begin
read(n);
p:=1;
for i:=1 to n do
begin
read(x[i]);
if(i mod 2 = 0) then
s+=x[i]
else
p*=x[i];
end;
writeln(s);
writeln(p);
end.
4.
var
A:array[1..100] of integer;
i,n:integer;
s1,s2,n1,n2:real;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(i mod 2 = 0) then
begin
s1+=a[i];
n1+=1;
end
else
begin
s2+=a[i];
n2+=1;
end;
end;
writeln(s1/n1);
writeln(s2/n2);
end.
5.
var
A:array[1..100] of integer;
i,n,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i]>0) and (i mod 2 = 0) then
s+=a[i];
end;
writeln(s);
end.
6.
var
A:array[1..100] of integer;
i,n,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i] mod 5 = 0) then
s+=a[i];
end;
writeln(s);
end.
7.
var
A:array[1..100] of integer;
i,n,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i] mod 3 = 0) and (a[i] mod 7 = 0) then
s+=a[i];
end;
writeln(s);
end.
8.
var
A:array[1..100] of integer;
i,n,max,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i]>max) then
max:=a[i];
end;
for i:=1 to n do
if(a[i]<max) then
s+=a[i];
writeln(s);
end.
var
A:array[1..100] of real;
i,n:integer;
s,p:real;
begin
read(n);
p:=1;
for i:=1 to n do
begin
read(a[i]);
s+=a[i];
p*=a[i];
end;
writeln(s);
writeln(p);
end.
2.
var
A:array[1..100] of real;
i,n:integer;
p:real;
begin
read(n);
p:=1;
for i:=1 to n do
begin
read(a[i]);
if(a[i]>0) then
p*=a[i];
end;
writeln(p);
end.
3.
var
X:array[1..100] of integer;
i,n,s,p:integer;
begin
read(n);
p:=1;
for i:=1 to n do
begin
read(x[i]);
if(i mod 2 = 0) then
s+=x[i]
else
p*=x[i];
end;
writeln(s);
writeln(p);
end.
4.
var
A:array[1..100] of integer;
i,n:integer;
s1,s2,n1,n2:real;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(i mod 2 = 0) then
begin
s1+=a[i];
n1+=1;
end
else
begin
s2+=a[i];
n2+=1;
end;
end;
writeln(s1/n1);
writeln(s2/n2);
end.
5.
var
A:array[1..100] of integer;
i,n,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i]>0) and (i mod 2 = 0) then
s+=a[i];
end;
writeln(s);
end.
6.
var
A:array[1..100] of integer;
i,n,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i] mod 5 = 0) then
s+=a[i];
end;
writeln(s);
end.
7.
var
A:array[1..100] of integer;
i,n,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i] mod 3 = 0) and (a[i] mod 7 = 0) then
s+=a[i];
end;
writeln(s);
end.
8.
var
A:array[1..100] of integer;
i,n,max,s:integer;
begin
read(n);
for i:=1 to n do
begin
read(a[i]);
if(a[i]>max) then
max:=a[i];
end;
for i:=1 to n do
if(a[i]<max) then
s+=a[i];
writeln(s);
end.
Vă mulțumim pentru vizita pe site-ul nostru dedicat Informatică. Sperăm că informațiile disponibile v-au fost utile și inspiraționale. Dacă aveți întrebări sau aveți nevoie de suport suplimentar, suntem aici pentru a vă ajuta. Ne face plăcere să vă revedem și vă invităm să adăugați site-ul nostru la favorite pentru acces rapid!