Cod sursa(job #393219)
Utilizator | Data | 9 februarie 2010 08:43:06 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<stdio.h>
#include<string.h>
char sep[]=" ';./,!?-:*+=",a[1000000], *p;
int lung,k;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(a);
p=strtok(a, sep);
while(p)
{
lung+=strlen(p);
k++;
p=strtok(NULL, sep);
}
printf("%ld", lung/k);
return 0;
}