Cod sursa(job #2132746)
Utilizator | Data | 15 februarie 2018 23:55:47 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
#include <iostream>
#include <cstring>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
char x[100000001];
int main()
{
int lung_totala,nr;
nr=lung_totala=0;
f.get(x,100000001);
char*p=strtok(x,"-,.!? 1234567890@#$%^&*()'\;");
while(p!=NULL)
{
lung_totala+=strlen(p);
nr++;
p=strtok(NULL,"-,.!? 1234567890@#$%^&*()'\;");
}
g<<lung_totala/nr;
return 0;
}