Răspuns:
Explicație:
program vector_patrate_perfecte;
const nmax=100;
type vector=array[1..nmax] of integer;
var v: vector;
element, n, i,k, m, num: integer;
begin
write('n='); read(n);
writeln('introdu ',n,' numere intregi, separate prin spatiu');
for i:=1 to n do
begin
read(element); num:=element;
if (element<0) then element:=-element;
m:=trunc(sqrt(element));
if (m*m=element)and(num>=0)
then begin inc(k); v[k]:=element; end;
end;
if k=0 then writeln('vector este vid')
else
begin
for i:=1 to k do
write(v[i],' ');
end;
end.