Cod sursa(job #607247)
Utilizator | Data | 11 august 2011 13:02:46 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
char ch;
long len=0,cuv=0,k=0;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c", &ch)!=EOF)
{
if (isalpha(ch)!=0)
{
len=len+1;
if (k==0)
cuv=cuv+1;
k=1;
}
else
k=0;
}
printf("%d\n",len/cuv);
return 0;
}