Cod sursa(job #1794940)
Utilizator | Data | 1 noiembrie 2016 20:49:57 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char s[1024*1024*20],t,*p,sep[]=" ,.-?!;:'({)}1234567890|][`~@#$%^&*_+=";
int i;
long long nr,l;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(s);
p=strtok(s,sep);
while(p!=NULL){
//printf("%s\n", p);
l+=strlen(p);
nr++;
p=strtok(NULL,sep);
}
//printf("%d %d\n", l, nr);
printf("%lld",l*1LL/nr);
return 0;
}