Pagini recente » Cod sursa (job #1785924) | Cod sursa (job #1698327) | Cod sursa (job #2777277) | Cod sursa (job #810825) | Cod sursa (job #819482)
Cod sursa(job #819482)
#include<stdio.h>
#include<string.h>
char s[1100000],x;
int w,ok,i,cnt,cnt2;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c",&x)+1)
{
if((x>='a'&&x<='z')||(x>='A'&&x<='Z')) {s[++w]=x;ok=1;}
if(x==' '&&ok) {s[++w]=' ';ok=0;}
}
s[++w]=' ';
for(i=1;i<=w;i++)
{
x=s[i];
if((x>='a'&&x<='z')||(x>='A'&&x<='Z')) cnt++;
if(x==' ') cnt2++;
}
cnt2++;
printf("%d\n",cnt/cnt2);
return 0;
}