Pagini recente » Cod sursa (job #2714829) | Cod sursa (job #561852) | Cod sursa (job #2381483) | Cod sursa (job #1055115) | Cod sursa (job #178106)
Cod sursa(job #178106)
#include<stdio.h>
#define N 110000
char c[N];
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int i,nc=0,nl=0;
bool ok=false;
fgets(c,N,stdin);
for(i=0; c[i]!='\0'; i++)
{
if((c[i]>='A')&&(c[i]<='Z')||(c[i]>='a')&&(c[i]<='z'))
{
nl++;
ok=true;
}
else
{
if(ok)
{
nc++;
ok=false;
}
}
}
if(ok)
nc++;
printf("%d\n",nl/nc);
return 0;
}