Cod sursa(job #2261426)

Utilizator Yoyo1912Ursoiu Ioana Yoyo1912 Data 16 octombrie 2018 11:01:05
Problema Text Scor 70
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[1000001],sep[7]=" -.,?!",*p,aux[501];
int n,i=-1,k,j,c;
int main()
{
    while(f.getline(s,1000001))
{p=strtok(s,sep);
while(p)
{k++;
c+=strlen(p);
    p=strtok(NULL,sep);

}
}
g<<c/k;
    return 0;
}