Pagini recente » Cod sursa (job #385391) | Cod sursa (job #2851667) | Cod sursa (job #2710676) | Cod sursa (job #2157498) | Cod sursa (job #1417652)
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std;
#define N 4096
char a[N],*p;
int litere()
{while(!((*p>='a'&&*p<='z')||(*p>='A'&&*p<='Z')))p++;
return strlen(p);
}
int main()
{char sep[]="!@#$%^&*()_+1234567890-=`~{}:|<>?[];,./ ";
long long s=0,nr=0;
FILE *f=freopen("text.in","r",stdin),*g=freopen("text.out","w",stdout);
while(fgets(a,N,f)!=NULL)
{p=strtok(a,sep);
while(p)
{s+=litere();++nr;p=strtok(NULL,sep);
}
}
fprintf(g,"%d",(int)s/nr);
}