Untitled
unknown
c_cpp
a year ago
482 B
0
Indexable
Never
#include <iostream> #include <cmath> using namespace std; int main() { int a; bool Near = false; cin >> a; int last_number = a % 10; a /= 10; while (a != 0) { if (last_number == a % 10) { Near = true; break; } else { last_number = a % 10; a /= 10; } } if (Near) { cout << "YES"; } else { cout << "NO"; } }