Cod sursa(job #532831)
| Utilizator | Data | 12 februarie 2011 16:19:30 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<cstdio>
#include<cstring>
using namespace std;
char c[1000],mat[1000][1000],*p,sep[]=" -,.!?";
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
long i,n=0,s=0;
gets(c);
p=strtok(c,sep);
while(p)
{
strcpy(mat[++n],p);
p=strtok(NULL,sep);
}
for(i=1;i<=n;i++)
s+=strlen(mat[i]);
printf("%ld",s/n);
return 0;
}
