Pagini recente » Cod sursa (job #2214456) | Cod sursa (job #1947072) | Cod sursa (job #2534482) | Profil ΩMΣGΔ | Cod sursa (job #315086)
Cod sursa(job #315086)
#include<stdio.h>
#define N 1000005
char s[N];
void citire()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fgets(s,N-1, stdin);
}
void sir()
{
long long c=0,l=0;
for (int i=0; s[i]; ++i)
{
if ((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
{
++l;
if (s[i+1]&&!((s[i+1]>='a'&&s[i+1]<='z')||(s[i+1]>='A'&&s[i+1]<='Z')))
{
++c;
}
else
if (!s[i+1])
++c;
}
}
if (l)
printf("%lld",l/c);
else
printf("0");
}
int main()
{
citire();
sir();
return 0;
}