Advertisement
vsonia2004

Maxim(cifra)

Nov 18th, 2019
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x,maxim,cifra;
  6. maxim=INT_MIN;
  7. do
  8. {
  9. cifra=x%10;
  10. if(cifra>maxim)
  11. {
  12. maxim=cifra;
  13. }
  14. x=x/10;
  15. }
  16. while(x!=0)
  17. cout<<maxim;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement