Cod sursa(job #893078)
| Utilizator | Data | 26 februarie 2013 12:55:41 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <cstdio>
#include <string.h>
long long x,nr;
char *p,s[1048578],sep[]={"- ,.!;_?><12345678890"};
int main ()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(s);
p=strtok(s,sep);
if(strlen(p)) x++,nr+=strlen(p);
while (p)
{
p=strtok(NULL,sep);
if(p==NULL) break;
if(strlen(p)) x++,nr+=strlen(p);
}
printf("%lld",nr/x);
return 0;
}
