Cod sursa(job #2447235)

Utilizator Vinti03Vintilescu Andrei Florin Vinti03 Data 12 august 2019 15:53:20
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <bits/stdc++.h>

using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
long long nrcuv,nrlit;
char s[100007],*p,sep[] = {" ,-!?.;'\""};
int main()
{
    fin.getline(s,100007);
    p = strtok(s,sep);
    while(p)
    {
        nrcuv++;
        nrlit += strlen(p);
        p = strtok(NULL,sep);
    }
    fout << nrlit/nrcuv;
    return 0;
}