Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- void Cifre(int n, int &c_min, int &c_max)
- {
- c_min = n % 10;
- c_max = n % 10;
- n/=10;
- while(n > 0)
- {
- if(n % 10 < c_min)
- c_min = n % 10;
- if(n % 10 > c_max)
- c_max = n % 10;
- n/=10;
- }
- }
- int main()
- {
- int a, b;
- Cifre(37232645, a, b);
- std::cout << a << " " << b;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement