Cod sursa(job #2155820)

Utilizator ohnoohnoSpalatelu Silvia ohnoohno Data 8 martie 2018 10:17:43
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 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()
{
    while (!f.eof())
    {
        f>>v[i++];
    }

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

    g<<S/(S/a);


    return 0;
}