Pagini recente » Cod sursa (job #2197732) | Cod sursa (job #1771225) | Cod sursa (job #1567363) | Cod sursa (job #2109078) | Cod sursa (job #1059638)
#include <stdio.h>
#include <string.h>
#include <ctype.h>
char text[10000000];
int nr_cuvinte;
int lungime;
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
gets(text);
int i = 0;
while (text[i])
{
while (text[i] && !isalpha(text[i]))
{
++i;
}
++nr_cuvinte;
while (text[i] && isalpha(text[i]))
{
++i;
++lungime;
}
}
printf("%d", lungime / nr_cuvinte);
return 0;
}