uses crt; var a:array[1..10] of real; i:longint; s:extended; begin clrscr; for i:=1 to 10 do begin write(‘Nhap gia tri phan tu thu ‘,i,’: ‘); readln(a[i]); if a[i]<0 then s:=s+sqr(a[i]); end; writeln(‘Tong binh phuong cac so am: ‘,s:0:2); readln; end.
uses crt;
var a: array[1..10] of real;
i: integer; s:real;
begin
clrscr;
for i:=1 to 10 do readln (a[i]);
for i:=1 to 10 do
if a[i]<0 then s:=s+sqr(a[i]);
writeln (‘tong binh phuong la: ‘,s);
readln;
uses crt;
var a:array[1..10] of real;
i:longint;
s:extended;
begin
clrscr;
for i:=1 to 10 do
begin
write(‘Nhap gia tri phan tu thu ‘,i,’: ‘); readln(a[i]);
if a[i]<0 then s:=s+sqr(a[i]);
end;
writeln(‘Tong binh phuong cac so am: ‘,s:0:2);
readln;
end.