Pagini recente » Cod sursa (job #485641) | Diferente pentru junior-challenge intre reviziile 3 si 4 | Borderou de evaluare (job #1915582) | Cod sursa (job #570546) | Cod sursa (job #2163)
Cod sursa(job #2163)
#include<fstream.h>
#include<math.h>
int nrc,nrl;
char s[1000000],*p,sep[]=" ,.!?-:;";
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f.getline(s,1000000);
p=strtok(s,sep);
while(p)
{
nrl+=strlen(p);
nrc++;
p=strtok(NULL,sep);
}
}
g<<floor(nrl/nrc);
return 0;
}