Pagini recente » Cod sursa (job #2735859) | Cod sursa (job #2947497) | Cod sursa (job #1930315) | Cod sursa (job #2526815) | Cod sursa (job #390602)
Cod sursa(job #390602)
# include <fstream>
# include <cstring>
using namespace std;
int main ()
{
long long int nrc=0, l=0, lc;
char c[2000000], sep[]="~`!^*()_-+=}{]\[;:\"\'|<,>.?/", *p;
ifstream fin ("text.in");
ofstream fout ("text.out");
while (fin>>c)
{
p=strtok(c, sep);
while (p)
{
lc=strlen(p);
if (lc)nrc++, l+=lc;
p=strtok(NULL, sep);
}
}
fout<<l/nrc;
return 0;
}