Cod sursa(job #2155841)

Utilizator ohnoohnoSpalatelu Silvia ohnoohno Data 8 martie 2018 10:37:58
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char v[50000],*cuv;
//char sep[10]=" .,?!:;-";
int S,a,i;
int main()
{
    f.get(v,50000,'\n');
       cuv=strtok(v," .,?!:;-");

    while (cuv)
        {
            a++;
            S=S+strlen(cuv);
            cuv=strtok(0," .,?!:;-");
        }

    g<<S/a;


    return 0;
}