Pagini recente » Cod sursa (job #2954315) | Cod sursa (job #2655047) | Cod sursa (job #2148496) | Cod sursa (job #2251188) | Cod sursa (job #1987291)
#include <fstream>
#include <cstring>
#define NM 2000000
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[NM], *p, fi[NM];
long long nr, x, y, total;
int main()
{
int i;
fin.getline(s, NM);
p=strtok(s, ".,!? -<>:;=+-_@#$%^&*(){}[]~` \\ \047 \042 ");
while (p)
{
strcpy(fi, p);
nr++;
total+=strlen(fi);
p=strtok(NULL, ".,!? -<>:;=+-_@#$%^&*(){}[]~` \\ \047 \042 ");
}
fout<<total/nr;
return 0;
}