Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int repeating_digits(int num)
- {
- int num_copy = num / 10;
- while (num_copy > 0)
- {
- while (num > 0)
- {
- if (num % 10 == num_copy % 10)
- return true;
- else
- num /= 10;
- }
- num_copy /= 10;
- }
- return false;
- }
- int main() {
- std::cout << repeating_digits(2158482);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement