Cod sursa(job #1541937)
Utilizator | Data | 4 decembrie 2015 18:58:27 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
int main()
{
int tot=0,cuv=0;
char text[99999999],*p;
ifstream f("text.in");
ofstream g("text.out");
f.get(text,99999999);
p=strtok(text," ,.;!?");
while(p){
tot=tot+strlen(p);
cuv++;
p=strtok(0," ,.;!?");
}
cout<<tot/cuv;
}