Cod sursa(job #1330840)

Utilizator Alex_MAlex M Alex_M Data 31 ianuarie 2015 00:29:16
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
    fstream f,g;
    f.open("text.in",ios::in);
    g.open("text.out",ios::out);
    long long nrCuv=0,nrLit=0,l;
    char text[1000003],*p,sep[]="., :';-_=+?!><[]|)(}{*&^%$#@\|/\0";
    f.getline(text,1000002);
    p=strtok(text,sep);
    do
    {
        l=strlen(p);
        nrCuv++; nrLit+=l;
        p=strtok(NULL,sep);
    }while(p!=NULL);
    g<<nrLit/nrCuv;
}