Cod sursa(job #1276184)

Utilizator andrei.arnautuAndi Arnautu andrei.arnautu Data 26 noiembrie 2014 00:26:58
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <cstdio>
#include <cstring>
using namespace std;
FILE *fin=freopen("text.in","r",stdin);
FILE *fout=freopen("text.out","w",stdout);
char *p, S[10000000], Sep[] = " -!?.,'/><~`@#$%^&*()_+=\}{[];:";
int Len, Nr;

int main()
{
    gets(S);
    p = strtok(S, Sep);
    while( p != NULL )
    {
        ++Nr;
        Len += strlen(p);
        p = strtok(NULL, Sep);
    }
    printf("%d", Len / Nr);
    return 0;
}