Pagini recente » Cod sursa (job #26278) | Cod sursa (job #2585714) | Cod sursa (job #112522) | Diferente pentru happy-coding-2007/solutii intre reviziile 27 si 28 | Cod sursa (job #260986)
Cod sursa(job #260986)
#include<fstream.h>
#include<string.h>
char *p,a[3000010],b[40]=" ,.?!-_+=[]{}();:'<>@#$%^&*()~`";
long s=0,c=0;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
f.get(a,3000000);
f.get();
p=strtok(a,b);
while(p)
{
s+=strlen(p);
c++;
p=strtok(NULL,b);
}
s=s/c;
g<<s;
return 0;
}