Pagini recente » Cod sursa (job #1928125) | Cod sursa (job #591742) | Cod sursa (job #1893506) | Diferente pentru problema/norocoase intre reviziile 8 si 7 | Cod sursa (job #1387023)
#include<fstream>
#include<string.h>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
int main()
{
char s[1000000];
int k=0,lung=0;
char *p;
char sep[]="\"',.?:;- ";
while(!cin.eof())
{
cin.getline(s,1000000);
p=strtok(s,sep);
while(p)
{
k++;
lung=lung+strlen(p);
p=strtok(NULL,sep);
}
}
cout<<lung/k;
return 0;
}