Pagini recente » Cod sursa (job #2013691) | Cod sursa (job #311918) | Profil madalinaqwerty | Cod sursa (job #151479) | Cod sursa (job #893043)
Cod sursa(job #893043)
#include <cstdio>
#include <string.h>
int x,nr;
char *p,s[1000],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("%ld",nr/x);
return 0;
}