#include<bits/stdc++.h>
using namespace std;
string lower(string ch)
{
int l = ch.size(), i, j;
for(i=0;i<l;i++)
{
if(ch[i] >= 'A' && ch[i] <= 'Z')
{
ch[i] = ch[i] + 32;
}
}
return ch;
}
int main()
{
string a, bp = "";
int c = 0, f = 1, i, j;
while(getline(cin , a))
{
int l = a.size();
string an = "";
for(i=0;i<l;i++)
{
if(a[i] == ' ' || a[i] == '.' || a[i] == ',')
{
int p = an.size();
if(c < p)
{
c = p;
bp = an;
}
an.clear();
}
else if(a[i]>= 'A' && a[i] <= 'Z' || a[i] >= 'a' && a[i] <= 'z' || a[i] == '-')
{
an.push_back(a[i]);
}
else
continue;
}
if(an == "E-N-D")
{
bp = lower(bp);
cout << bp << endl;
break;
}
}
return 0;
}
using namespace std;
string lower(string ch)
{
int l = ch.size(), i, j;
for(i=0;i<l;i++)
{
if(ch[i] >= 'A' && ch[i] <= 'Z')
{
ch[i] = ch[i] + 32;
}
}
return ch;
}
int main()
{
string a, bp = "";
int c = 0, f = 1, i, j;
while(getline(cin , a))
{
int l = a.size();
string an = "";
for(i=0;i<l;i++)
{
if(a[i] == ' ' || a[i] == '.' || a[i] == ',')
{
int p = an.size();
if(c < p)
{
c = p;
bp = an;
}
an.clear();
}
else if(a[i]>= 'A' && a[i] <= 'Z' || a[i] >= 'a' && a[i] <= 'z' || a[i] == '-')
{
an.push_back(a[i]);
}
else
continue;
}
if(an == "E-N-D")
{
bp = lower(bp);
cout << bp << endl;
break;
}
}
return 0;
}
Comments
Post a Comment