Cod sursa(job #1857635)

Utilizator VictorAndreiCotescu Victor Andrei VictorAndrei Data 26 ianuarie 2017 14:57:24
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 kb
#include <iostream>
#include <string.h>
#include <fstream>

using namespace std;

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

int main()
{
        char s[256], *p;
        int S=0, nr=0;

            while(f>>s)
            {
                p=strtok(s, " ,;.?!-");
                cout << p << "\n";
                    while(p)
                    {

                S=S+strlen(s);
                nr++;
                p=strtok(NULL, " ,;.?!-");

                    }


            }

            g << S/nr;



}