Pagini recente » Cod sursa (job #2477114) | Cod sursa (job #377429) | Cod sursa (job #1517285) | Cod sursa (job #868258) | Cod sursa (job #2615946)
#include <fstream>
#include <algorithm>
#include <cstring>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
const int lim=1e6+10;
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])==true)
++l,++ind;
}
else
{
while(ind<n and tip(s[ind])==false)
++ind;
}
}
if(cnt==0) cout<<0<<'\n';
else cout<<l/cnt<<'\n';
return 0;
}