Răspuns :
Răspuns:
int n,u,z,s;
cin >>n;
u = n%10;
n = n/10;
z = n%10;
n = n/10;
s= n%10;
If (z==s+1 && u=z+1) cout <<" da";
else cout << "nu";
#include <iostream>
using namespace std;
bool has_three_consecutive_digits(int number)
{
if (number <= 110 && number >= -110)
return false;
int digit = number % 10, count = 1;
number /= 10;
while (number)
{
if (number % 10 != digit)
{
digit = number % 10;
count = 1;
}
else
++count;
if (count == 3)
return true;
number /= 10;
}
return false;
}
int main()
{
int n;
cin >> n;
cout << has_three_consecutive_digits(n);
}