Cod sursa(job #708932)
Utilizator | Data | 7 martie 2012 15:53:09 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <stdio.h>
#include <string.h>
#include <ctype.h>
char sep[]=",.()+-!/ ",s[1001],*p;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(s);
int sum=0,nrc=0;
p=strtok(s,sep);
do
{
sum+=strlen(p);
nrc++;
p=strtok(NULL,sep);
}while(p!=NULL);
printf("%d\n",sum/nrc);
return 0;
}