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