Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void identice(int a, int b)
- {
- int i, aux, x, nr;
- for(i = a; i <= b; i++)
- {
- nr = i;
- aux = 0;
- x = nr % 10;
- while(nr > 10 && aux == 0)
- {
- nr = nr / 10;
- if(x != nr % 10)
- aux = 1;
- x = nr % 10;
- }
- if(aux == 0)
- cout << i << " ";
- }
- }
- int main()
- {
- identice(700, 1500);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement