Pagini recente » Cod sursa (job #2031853) | Rating Diculescu Elena Alexandra (portocala) | Istoria paginii utilizator/xtremexcata | FMI_NoMercy235 | Cod sursa (job #41885)
Cod sursa(job #41885)
#include<fstream.h>
#include<math.h>
ifstream f("text.in");
ofstream g("text.out");
long int nrc=0,nrl=0;
char s[10000000],*p,sep[]=" ,./;'[]-=\<>?:{}_+|";
int main()
{
while(!f.eof())
{
f.getline(s,10000000);
p=strtok(s,sep);
while(p)
{
nrl+=strlen(p);
nrc++;
p=strtok(NULL,sep);
}
}
g<<floor(nrl/nrc);
return 0;
}