Cod sursa(job #329352)
| Utilizator | Data | 5 iulie 2009 22:08:22 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#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;
}
