Pagini recente » Cod sursa (job #1459272) | Cod sursa (job #3162862) | Cod sursa (job #2160974) | Cod sursa (job #940665) | Cod sursa (job #397904)
Cod sursa(job #397904)
# include <fstream>
# include <cstring>
using namespace std;
int main ()
{
long long int nrc=0, l=0, lc;
char c[206000], 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;
}