Pagini recente » Cod sursa (job #2086767) | Cod sursa (job #1176673) | Cod sursa (job #2961018) | Cod sursa (job #2909511) | Cod sursa (job #1090256)
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int i,cate,nrc,g,n;
char a[1000001];
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
cin.get(a,1000001);
cin.get();
n=strlen(a);
cate=0;
nrc=0;
for(i=0;i<=n-1;i++)
{
if(strchr("acdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a[i])!=0)cate++;
if(strchr("acdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a[i])==0&&strchr("acdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a[i+1])!=0)nrc++;
}
if(strchr("acdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a[0])!=0)nrc++;
g=cate/nrc;
printf("%d\n",g);
}