fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int max = 0;
  7. int a, n, c,col;
  8. cin >> a;
  9. while (a>0)
  10.  
  11. {
  12. n = a % 10;
  13. if (n > max) max = n;
  14.  
  15. a /= 10;
  16.  
  17. }
  18. cout << max << endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 15232KB
stdin
88928898
stdout
9