Pagini recente » Cod sursa (job #2623471) | Cod sursa (job #1633077) | Cod sursa (job #111088) | Cod sursa (job #2137873) | Cod sursa (job #2600637)
#include <bits/stdc++.h>
#define ull unsigned long long
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char s[1000002],x[1000002],
sep[100];
int main()
{
int dim=0;
for (int i=32;i<=126;++i)
if (!isalpha(i)){
sep[dim++]=char(i);
}
ull cnt=0,nr=0;
while (in.getline(x,1000002)){
s[strlen(s)]=' ';
strcat(s,x);
}
char *p=strtok(s,sep);
while (p){
cnt++;
nr+=strlen(p);
p=strtok(NULL,sep);
}
out<<nr/cnt;
}