Editorial for Четни Числа


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.
by: maya

Тестовете можете да видите тук.

Примерно решение на C++:

#include <iostream>
#include <string>
using namespace std;
int main()
{

    int a=0;
    int max=-1;
    char ch;
    bool b=false;

    do
    { 
        cin.get(ch);
        if ( ch>='0' && ch<='9')
        {
          a=a*10+(ch-48); b=1;
        }
        else
        {
           if (b && (a%2==0) && a>max)
           {
              max=a;
           }
           a=0;
        }
     }
    while (ch!='.');

    cout<<max<<endl;

    return 0;
}

Comments

There are no comments at the moment.