Cod sursa(job #1986619)

Utilizator Cristian25Cristian Stanciu Cristian25 Data 28 mai 2017 19:07:14
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");
int main()
{
    char t[1000000],* p,sep[]=" `~!@#$%^&*()_-+={}[]\|;:'""<,.>?/";
    int nr=0,s=0;
    f.get(t,1000000);
    p=strtok(t,sep);
    while(p!=NULL)
    {
        nr++;
        s+=strlen(p);
        p=strtok(NULL,sep);
    }
    g<<s/nr<<'\n';
    return 0;
}