Cod sursa(job #1541931)
Utilizator | Data | 4 decembrie 2015 18:47:35 | |
---|---|---|---|
Problema | Text | Scor | 40 |
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[255],*p;
ifstream f("text.in");
ofstream g("text.out");
f.get(text,255);
p=strtok(text," ,.;!?");
while(p){
tot=tot+strlen(p);
cuv++;
p=strtok(0," ,.;!?");
}
g<<tot/cuv;
}