Facebook
From Cute Sloth, 3 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 68
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     long long n,c,maxx=0;
  7.     cin >> n;
  8.         while(n!=0)
  9.         {
  10.             c=n%10;
  11.             n/=10;
  12.             if(c%2==1 && c>maxx)
  13.                 maxx=c;
  14.         }
  15.         if(maxx==0){
  16.             cout<<"nu exista";
  17.         }else
  18.         cout<<maxx;
  19.     return 0;
  20. }