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