Procedure TForm1.СтартClick(Sender: TObject); var i, j, k, Chislo: Integer; begin Memo1.Clear; k:=0; for i := 1 to 9 do for j := 0 to 9 do begin Chislo := i*10+j; if ( Frac(Chislo/(i+j))=0 ) then begin inc(k); Memo1.Lines.Append( IntToStr(Chislo)); end; end; Memo1.Lines.Append('Количество = ' + IntToStr(k)); end;
Вот они 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90
var
i, j, k, Chislo: Integer;
begin
Memo1.Clear;
k:=0;
for i := 1 to 9 do
for j := 0 to 9 do
begin
Chislo := i*10+j;
if ( Frac(Chislo/(i+j))=0 ) then
begin
inc(k);
Memo1.Lines.Append( IntToStr(Chislo));
end;
end;
Memo1.Lines.Append('Количество = ' + IntToStr(k));
end;