Pagini recente » Cod sursa (job #2638686) | Cod sursa (job #2578356) | Cod sursa (job #1056654) | Cod sursa (job #2276313) | Cod sursa (job #329352)
Cod sursa(job #329352)
#include<cstdio>
#define N 2000005
char s[N];
void citire()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fgets(s,N-1,stdin);
bool ok;
int c=0,l=0;
for (int i=0; s[i]&&s[i]!=10; ++i)
{
ok=false;
while ((s[i]<'A'&&s[i]>'Z')||(s[i]<'a'&&s[i]>'z')&&s[i]&&s[i]!=10)
++i;
while ((s[i]>='A'&&s[i]<='Z')||(s[i]>='a'&&s[i]<='z')&&s[i]&&s[i]!=10)
{
ok=true;
++l;
++i;
}
if (ok) ++c;
}
printf("%d",l/c);
}
int main()
{
citire();
return 0;
}