Advertisement
SergeyPGUTI

4.2.1

Sep 29th, 2015
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n,Max=0;
  8.     cin>>n;
  9.     while(n!=0)
  10.     {
  11.         if (Max<(n%10))
  12.             Max=n%10;
  13.         n/=10;
  14.     }
  15.     cout<<Max;
  16.  return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement