Pagini recente » Cod sursa (job #263583) | Cod sursa (job #3216869) | Statistici Matei Lupu (mateilupu) | Cod sursa (job #2563466) | Cod sursa (job #608812)
Cod sursa(job #608812)
#include <stdio.h>
int main()
{
char c;
int litere=0,cuvinte=0,h=0;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c", &c) != EOF)
{
if(c >= 'a' && c <= 'z' || c>='A' && c<= 'Z')
{
litere++;
h=1;
}
else if(h==1)
{
cuvinte++;
h=0;
}
}
if(h == 1)
cuvinte++;
printf("%d", litere/cuvinte);
return 0;
}