Cod sursa(job #36360)
Utilizator | Data | 23 martie 2007 14:15:40 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<stdio.h>
#include<ctype.h>
long cuv,a,b,d,nr,s,j,k,l;
char c;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
cuv=1;
scanf("%c",&c);
if (isalpha(c))
{
cuv=0;
nr++;
k++;
}
while (scanf("%c",&c)!=EOF)
{
if (isalpha(c))
{
k++;
if (cuv)
{
nr++;
cuv=0;
}
}
else
cuv=1;
}
printf("%ld\n",k/nr);
return 0;
}