Cod sursa(job #487886)
Utilizator | Data | 26 septembrie 2010 19:51:51 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<stdio.h>
#include<string.h>
char separatori[]=" !#$%&'()*+,-./:;<=>?@[]^_`~{}";
char s[100000],*p;
int lg,nr;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(s);
p=s;
p=strtok(p,separatori);
while(p)
{
lg+=strlen(p);
nr++;
p=strtok(NULL,separatori);
}
printf("%d",lg/nr);
return 0;
}