Cod sursa(job #858589)
Utilizator | Data | 19 ianuarie 2013 01:04:16 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<cstdio>
#include<cstring>
char str[100000],*pch;
long long size,k;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(str);
pch = strtok (str," ,.-!?");
while (pch != NULL)
{
size+=strlen(pch);
k++;
pch = strtok (NULL, " ,.-!?");
}
printf("%d\n",size/k);
return 0;
}