Cod sursa(job #141957)
Utilizator | Data | 23 februarie 2008 22:31:14 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<stdio.h>
#include<ctype.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char c;
int ct=0,lt=0,a=-1;
while(scanf("%c",&c)!=EOF)
{
if(isalpha(c))
{
++lt;
if(a==-1)
{
++ct;
a=1;
}
}
else
a=-1;
}
printf("%d",lt/ct);
return 0;
}