Pagini recente » Cod sursa (job #2340572) | Cod sursa (job #2447789) | Cod sursa (job #2250073) | Cod sursa (job #576381) | Cod sursa (job #329407)
Cod sursa(job #329407)
#include <stdio.h>
char c;
int nr,cont;
int main()
{
int fol;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
c=fgetc(stdin);
while(! (c>='A' && c<='Z') || (c>='a' && c<='z') )
c=fgetc(stdin);
while(!feof(stdin))
{
if( (c>='A' && c<='Z') || (c>='a' && c<='z') )
{
++nr;
fol=0;
}
else
if(fol==0)
{
++cont;
fol=1;
}
c=fgetc(stdin);
}
if(fol==0)
++cont;
printf("%d",nr/cont);
return 0;
}