Cod sursa(job #518088)

Utilizator ioanabIoana Bica ioanab Data 30 decembrie 2010 15:02:12
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <stdio.h>
#include <string.h>
const int N=1000000;

char s[N];

int main()
{
        freopen("text.in","r",stdin);
        freopen("text.out","w",stdout);
        char *p,sep[]=" .,?![]-:;'+=`~@#$%^&*()_|/><";
        int n,nr;

        gets(s);
        n=0;
		nr=0;
        p=strtok(s,sep);
        while(p)
                {
                        n++;
						nr+=strlen(p);
                        p=strtok(NULL,sep);
						
                }
        printf("%d\n",nr/n);

        return 0;
}