Cod sursa(job #1794855)
Utilizator | Data | 1 noiembrie 2016 19:40:41 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char s[10001],t,*p,sep[]=" ,.-?!;:'({)}";
int i,nr,l;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(s);
p=strtok(s,sep);
nr++; l=strlen(p);
while(p!=0){
l+=strlen(p);
nr++;
p=strtok(NULL,sep);
}
printf("%d",l/nr);
return 0;
}