Cod sursa(job #518087)
Utilizator | Data | 30 decembrie 2010 14:59:00 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <stdio.h>
#include <string.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char s[205],*p,sep[]=" .,?![]-";
int n,nr;
gets(s);
n=0;
nr=0;
p=strtok(s,sep);
while(p)
{
n++;
nr+=strlen(p);
p=strtok(NULL,sep);
}
printf("%d\n",nr/n);
return 0;
}