Const n = 10; var a :array [1..n] of integer; i, sum :integer; begin for i:= 1 to n do readln(a[i]); sum:= 0; for i:= 1 to n do if a[i] > 0 then sum:= sum + a[i]; sum:= sqr(sum); writeln(sum); end.
Const N = 10; Var i,S:integer; m:array [1..N] of integer; Begin Writeln('Введите массив'); for i:=1 to 10 do begin readln(m[i]); if m[i]>0 then S:=S+m[i]; end; S:=sqr(S); writeln('Сумма^2 равна ',S); readln; end.
begin
for i:= 1 to n do readln(a[i]); sum:= 0; for i:= 1 to n do if a[i] > 0 then sum:= sum + a[i]; sum:= sqr(sum); writeln(sum); end.
Var i,S:integer; m:array [1..N] of integer;
Begin
Writeln('Введите массив');
for i:=1 to 10 do begin
readln(m[i]);
if m[i]>0 then S:=S+m[i]; end;
S:=sqr(S);
writeln('Сумма^2 равна ',S);
readln;
end.