Pagini recente » Cod sursa (job #1011641) | Cod sursa (job #2571302) | Cod sursa (job #1543024) | Cod sursa (job #2694739) | Cod sursa (job #2737396)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
long long cnt,length;
char s[100000010], delim[]=" -,.!?`=[]'/\{}:<>_+",*p;
int main() {
fin.getline(s,100000000);
for (int i=0;s[i]!=0;i++) {
if ((s[i]>='0'&&s[i]<='9')||(s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
length++;
}
p=strtok(s,delim);
while (p!=nullptr) {
p=strtok(nullptr,delim);
cnt++;
}
fout<<1LL*length/cnt;
return 0;
}