sum:=0; for i:=1 to n do begin if (a[i] mod 3 = 0) and (a[i] mod 5 = 0) THEN sum:=sum+a[i]; end; showmessage('otvet =' + inttostr(sum));