Advertisement
a53

cmmcp

a53
Dec 9th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #define LL long long int
  3. using namespace std;
  4.  
  5. int cmm_cif_para(LL n)
  6. {
  7. int cmmcp=-1;
  8. if(n==0)
  9. cmmcp=0;
  10. else
  11. while(n)
  12. {
  13. if(n%10%2==0&&n%10>cmmcp)
  14. cmmcp=n%10;
  15. n/=10;
  16. }
  17. if(cmmcp==-1)
  18. return 10;
  19. else
  20. return cmmcp;
  21. }
  22.  
  23. int main()
  24. {
  25. LL n;
  26. cin>>n;
  27. cout<<cmm_cif_para(n)<<'\n';
  28. return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement