Pagini recente » Cod sursa (job #75877) | Cod sursa (job #2486799) | Cod sursa (job #3207531) | Cod sursa (job #1525554) | Cod sursa (job #470047)
Cod sursa(job #470047)
#include <cstdio>
#include <iostream>
using namespace std;
bool iflit(char c)
{
if (('a'<=c && c<='z') || ('A'<=c && c<='Z'))
return true;
return false;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
bool cuvant=false;
char c;
int nrCuvinte=0,lg=0,nrLit=0;
while(!feof(stdin))
{
scanf("%c",&c);
bool lit=iflit(c);
if (lit) ++nrLit;
if (lit && !cuvant)
{
++nrCuvinte;
cuvant=true;
lg=0;
}
else if (!lit && cuvant)
{
cuvant=false;
}
}
cout<<nrLit/nrCuvinte;
return 0;
}