begin
var n := Abs(ReadInteger('Введите целое число:'));
var yes := False;
var n1 := n mod 10;
n := n div 10;
while n > 0 do
begin
var n2 := n mod 10;
if n1 = n2 then
begin
yes := True;
break
end;
n := n div 10;
n1 := n2
end;
if yes then Print('Верно')
else Print('Неверно')
end.
begin
var s := Abs(ReadInteger('Введите целое число:')).ToString;
if s.Pairwise.Any(t->t[0]=t[1]) then Print('Верно')
else Print('Неверно')
end.
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
int d = a%10;
string s = "yes";
while(abs(a) > 0) {
if(a%10 != d) {
s = "no";
break;
}
a/=10;
}
cout << s << endl;
}
2)
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
int d = a%10;
a/=10;
string s = "no";
while(abs(a) > 0) {
if(a%10 == d) {
s = "yes";
break;
}
d = a%10;
a/=10;
}
cout << s << endl;
}