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()
{
        string s;
        int br=0,max=0,sz,i;
        getline(cin,s);
        sz=s.size();
        for(i=0;i<sz;i++)
        {
              if (!(s[i]>='A'&&s[i]<='Z')&&!(s[i]>='a'&&s[i]<='z')&&!(s[i]>='0'&&s[i]<='9')&&s[i]!=' '&&s[i]!='.') br++;
              else
              {
                  if (br>max) max=br;
                  br=0;
              }
        }

        if(br>=max) max=br;
        cout<<max<<endl;

        return 0;
}

Comments

There are no comments at the moment.