Pagini recente » Rating UPTLateRegistry (UPT_Patrascoiu_Teudan_Nume3) | Rating Echipa UTCN Hagyma (Hagyma_Kerekes_Varady_Zongor) | Profil UPT_Lupu_Kiss_Buliga | Cod sursa (job #3272985) | Cod sursa (job #3276219)
#include<fstream>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c[1000001];
int main()
{
int nr_cuv = 1, lungime_cuv = 0;
f.get(c, 1000001);
char* p = strtok(c, " -.?/';:<>!()");
while (p)
{
lungime_cuv += strlen(p);
nr_cuv++;
p = strtok(NULL, " -.?/';:<>!()");
}
g << lungime_cuv / nr_cuv;
}