const n=20;
var
a:array[1..n] of integer;
i:integer;
s:real;
begin
randomize;write('Массив А: ');
s:=0;
for i:=1 to n do begin
while a[i]
write(a[i]:5);
if (a[i] div 100=a[i]div 10 mod 10)and(a[i]div 100=a[i] mod 10)then s:=s+a[i];
end;
writeln(#13+'Сумма=',s:0:0);
end.