Pagini recente » Istoria paginii runda/oni2014_z1_ix/clasament | Cod sursa (job #1878667) | Istoria paginii runda/becreative24 | Istoria paginii runda/25tui/clasament | Cod sursa (job #1878658)
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lgmax=0,nrcuv=0,lgmedie=0;
char s[1000000001];
int main()
{
while(f.getline(s,1000000001))
{
char *p=strtok(s," .,;/?-!_+=");
while(p)
{
lgmax+=strlen(p);
nrcuv+=1;
p=strtok(NULL," .,;/?-!_+=");
}
}
lgmedie=lgmax/nrcuv;
g<<lgmedie;
f.close();
g.close();
return 0;
}