Cod sursa(job #1408844)

Utilizator DragosCDragos Corleanca DragosC Data 30 martie 2015 11:50:01
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <iostream>
#include <fstream>
#include <cstring>
#define nmax 1048580
#define delims "1234567890-=[];'\`/.,!@#$%^&*()_+{}:|<>?~ "
using namespace std;

int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    char s[nmax],*p;
    int suma=0,c=0;
    f.get(s,nmax);
    p=strtok(s,delims);
    while(p!=NULL)
    {
        suma+=strlen(p);
        c++;
        p=strtok(NULL,delims);
    }
    cout<<suma/c;
    return 0;
}