Pagini recente » Cod sursa (job #2093417) | Cod sursa (job #1836097) | Cod sursa (job #3134639) | Borderou de evaluare (job #3223670) | Cod sursa (job #1523393)
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
string text;
long long int lt = 0;
long long int nr = 0;
long long int many = 0;
int main()
{
getline(in,text);
in.close();
for(unsigned int i=0;i<text.size();i++)
if(((text[i]>='a')&&(text[i]<='z')) || ((text[i]>='A')&&(text[i]<='Z')))
many++;
else
{
if(many)
{
nr++;
lt+=many;
many = 0;
}
}
if(nr)
out<<lt/nr<<'\n';
else
out<<0<<'\n';
out.close();
return 0;
}