Pagini recente » Cod sursa (job #715112) | Cod sursa (job #2809964) | Cod sursa (job #1392092) | Diferente pentru preoni-2007/runda-3/solutii intre reviziile 42 si 41 | Cod sursa (job #1554782)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[1200000],*p,sep[200],ch;
int l=0,nr=0;
int main ()
{
for(ch=32;ch<=126;ch++)
if(!(ch>='a' && ch<='z' || ch>='A' && ch<='Z'))
{
sep[l]=ch;
l++;
}
sep[l]=0;
l=0;
f.get(s,1200000);
p=strtok(s,sep);
while (p!=NULL)
{
nr++;
l=l+strlen(p);
p=strtok(NULL,sep);
}
g<<l/nr;
g.close();
return 0;
}