
04.05.2012, 12:31
|
 |
Местный
|
|
Регистрация: 14.12.2011
Сообщения: 481
Версия Delphi: Borland Delphi7
Репутация: 17
|
|
Код:
procedure TForm1.Button1Click(Sender: TObject);
var value,ovalue,c:Integer;
o:byte;
th: set of 0..9;
begin
th:=[];
value:=strtointdef(edit1.Text,0);
c:=0;
while (value>0) and (c<=2) do begin
ovalue:=value;
value:=value div 10;
o:=ovalue-value*10;
if not(o in th) then inc(c);
th:=th+[o];
end;
if c<=2 then
showmessage('Двоякое') else
showmessage('Недвоякое');
end;
|