Pagini recente » Cod sursa (job #1567690) | Cod sursa (job #687168) | Cod sursa (job #2056188) | Diferente pentru problema/norocoase intre reviziile 7 si 8 | 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;
}