Code
Program ThreeCifryi;
Uses CRT;
Var s: String;
code, x: Integer;
f: Boolean;
Begin
ClrScr;
Repeat
Write('Enter the num: '); Readln(s);
Val(s, x, code);
Until (length(s) = 3) and (code = 0);
If (s[1] = s[2]) and (s[1] = s[3]) then
Begin
Writeln('Sovpali vse 3 cifryi');
f := True;
End
else
Begin
If (s[1] = s[2]) or (s[2] = s[3]) or (s[1] = s[3]) then
Begin
Writeln('Sovpali 2 cifryi');
f := True;
End;
End;
If (not f) then Writeln('Vse cifryi raznyie');
ReadKey;
End.