Cod sursa(job #301878)
Utilizator | Data | 8 aprilie 2009 15:02:56 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<stdio.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char c;
long s=0,sz=0,k,ok=0;
while (scanf("%c",&c)!=EOF)
{
if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
s++;
if (!ok)
sz++;
ok=1;
}
else
ok=0;
}
if (sz)
{ k=s/sz;
printf("%ld",k);
}
else printf("0");
return 0;
}