Pagini recente » Cod sursa (job #1823077) | Cod sursa (job #364273) | Cod sursa (job #1989767) | Cod sursa (job #1890384) | Cod sursa (job #397905)
Cod sursa(job #397905)
# include <fstream>
# include <cstring>
using namespace std;
int main ()
{
long long int nrc=0, l=0, lc;
char c[206000], sep[]="\`~1234567890!{@#$%^&**()-}|\":+?=><,./;[]", *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;
}