Pagini recente » Cod sursa (job #384892) | Cod sursa (job #1011681) | Cod sursa (job #785201)
Cod sursa(job #785201)
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
long long l=0;
int cuv=0;
bool k=0;
char c;
scanf("%c",&c);
if((c<='z'&&c>='a')||(c<='Z'&&c>='A'))
{
k=l=1;
}
while( !feof(stdin))
{
scanf("%c",&c);
if((c<='z'&&c>='a')||(c<='Z'&&c>='A'))
if(k!=1)
{
++l;
k=1;
}
else
{
++l;
}
else
if(k==1)
{
++cuv;
k=0;
}
}
//printf("%d",cuv);
printf("%d",l/cuv);
return 0 ;
}