Cod sursa(job #1878677)

Utilizator PrEaDiVviNAlexandru Hutu PrEaDiVviN Data 14 februarie 2017 12:55:23
Problema Text Scor 80
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <bits/stdc++.h>
#include <string.h>
using namespace std;

ifstream f("text.in");
ofstream g("text.out");

char sep[]=",.:;-?/! _+=",*p,c[100000001];
int main()
{
    long long lit=0,nrcuv=0;
    while(f.getline(c,1000000000))
    {
    p=strtok(c,sep);
    while(p)
    {
        lit+=strlen(p);
        nrcuv++;
        p=strtok(NULL,sep);
    }
    }
    g<<lit/nrcuv;




}