Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void cifra(int n, int &x)
- {
- x=0;
- while(n)
- {
- if(n%10>x)
- x=n%10;
- n=n/10;
- }
- }
- int main()
- {
- int n=954345, x=0;
- cifra(n,x);
- cout<<x;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement