Pagini recente » FMI_NoMercy235 | Cod sursa (job #2780919) | Cod sursa (job #2288875) | Cod sursa (job #1949153) | Cod sursa (job #549244)
Cod sursa(job #549244)
#include <iostream>
#include<fstream>
#include<string.h>
using namespace std;
fstream f("text.in",ios::in);
fstream g("text.out",ios::out);
long i,n,nrc;
char a[20000000],*p;
int main()
{n=0;
nrc=0;
while(!f.eof())
{f>>a;
if(!f.eof())
{
p=strtok(a," .,!?-");
while(p)
{
nrc++;
n=n+strlen(p);
p=strtok(NULL," .,!?-");
}
}
}
g<<n/nrc;
return 0;
}