Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, y;
- int max = 0;
- int max2 = 0;
- cout << "x= ";
- cin >> x;
- cout << "y= ";
- cin >> y;
- int min = x % 10;
- int min2 = y % 10;
- while (x != 0 && y!=0)
- {
- if (max < x % 10)
- {
- max = x % 10;
- }
- if (min > x % 10)
- {
- min = x % 10;
- }
- x = x / 10;
- if (max2 < y % 10)
- {
- max2 = y % 10;
- }
- if (min2 > y % 10)
- {
- min2 = y % 10;
- }
- y = y / 10;
- }
- cout << max * 10 + max2 << endl;
- cout << min * 10 + min2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement