Cod sursa(job #178108)
Utilizator | Data | 14 aprilie 2008 08:45:12 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<stdio.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int nc=0,nl=0;
char x;
bool ok=false;
while(scanf("%c",&x)!=EOF)
{
if((x>='A')&&(x<='Z')||(x>='a')&&(x<='z'))
{
nl++;
ok=true;
}
else
{
if(ok)
{
nc++;
ok=false;
}
}
}
if(ok)
nc++;
printf("%d\n",nl/nc);
return 0;
}