var number, currentDigit, previousDigit: integer; hasTwoSameDigits: boolean;
begin write('Enter a integer number: '); readln(number);
hasTwoSameDigits := false; previousDigit := number mod 10; number := number div 10;
while number > 0 do begin currentDigit := number mod 10;
if currentDigit = previousDigit then begin hasTwoSameDigits := true; break; end; previousDigit := currentDigit; number := number div 10;
end;
if hasTwoSameDigits then writeln('The number has two same digits standing nearby.') else writeln('The number does not have two same digits standing nearby.'); end.
program TwoSameDigits;
var
number, currentDigit, previousDigit: integer;
hasTwoSameDigits: boolean;
begin
write('Enter a integer number: ');
readln(number);
hasTwoSameDigits := false;
previousDigit := number mod 10;
number := number div 10;
while number > 0 do
if currentDigit = previousDigit thenbegin
currentDigit := number mod 10;
begin
hasTwoSameDigits := true;
break;
end;
previousDigit := currentDigit;
number := number div 10;
end;
if hasTwoSameDigits then
writeln('The number has two same digits standing nearby.')
else
writeln('The number does not have two same digits standing nearby.');
end.