Pagini recente » Cod sursa (job #1594339) | Cod sursa (job #2227417) | Cod sursa (job #1772503) | Cod sursa (job #572738) | Cod sursa (job #2203600)
#include <bits/stdc++.h>
using namespace std;
char c;
int n,i;
//ofstream fout("text.out");
bool litera(char c)
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
return 1;
return 0;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
//FILE *pfile;
//pfile=fopen("text.out","w+");
bool ok=0;
int lungime=0,cuvinte=0;
while( scanf("%c",&c) == 1)
{
if(litera(c)==1)
{
lungime++;
ok=1;
}
else if(ok==1)
{
ok=0;
cuvinte++;
}
}
printf("%d",lungime/cuvinte);
//cout<<lungime/cuvinte;
return 0;
}