Pagini recente » Cod sursa (job #1369479) | Cod sursa (job #968922) | Cod sursa (job #2985823) | Cod sursa (job #1432935) | Cod sursa (job #893086)
Cod sursa(job #893086)
#include <cstdio>
#include <string.h>
long long x,nr;
char *p,s[1048578],sep[]={"- ,.!;_?><)(@#$%^/\|~`'"};
int main ()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(s);
p=strtok(s,sep);
if(strlen(p)) x++,nr+=strlen(p);
while (p)
{
p=strtok(NULL,sep);
if(p==NULL) break;
if(strlen(p)) x++,nr+=strlen(p);
}
printf("%lld",nr/x);
return 0;
}