Pagini recente » Cod sursa (job #2947764) | Cod sursa (job #1736301) | Cod sursa (job #1446698) | Cod sursa (job #1833890) | Cod sursa (job #2615945)
#include <fstream>
#include <algorithm>
#include <cstring>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
const int lim=1e6+3;
char s[lim];
bool tip(char ch)
{return ((ch>='a' and ch<='z') or (ch>='A' and ch<='Z'));}
int main()
{
int n,cnt,l,ind;
cin.getline(s,lim);
n=strlen(s);
cnt=l=ind=0;
while(ind<n)
{
if(tip(s[ind]))
{
++cnt;
while(ind<n and tip(s[ind]))
++l,++ind;
}
while(ind<n and !tip(s[ind]))
++ind;
}
if(cnt==0) cout<<0<<'\n';
else cout<<l/cnt<<'\n';
return 0;
}