Advertisement
alex326

Untitled

Jan 16th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. problema 2288
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,m=0;
  8. cin>>n;
  9. while (n!=0){
  10. if ((n%10>m) and (n%10%2==1))
  11. m=n%10;
  12. n=n/10;
  13. }
  14. if (m==0)
  15. cout<<"nu exista";
  16. else
  17. cout<<m;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement