Pagini recente » Cod sursa (job #2193708) | Cod sursa (job #1435991) | Cod sursa (job #1715158) | Cod sursa (job #1985852) | Cod sursa (job #809370)
Cod sursa(job #809370)
#include<cstdio>
#include<cstring>
using namespace std;
inline bool litera(char x)
{
if ((x>=97 && x<=122) || (x>=65 && x<=90)) return true;
else return false;
}
inline void citire()
{
char x,y;
long long s=0,n=0,nr=0;
while (x!='\n')
{
scanf("%c",&x);
if (litera(x)) nr++;
else {
if (litera(y)) {
s+=nr;
if (nr!=0) n++;
nr=0;
}
}
y=x;
}
printf("%lld",(int)s/n);
return;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
citire();
fclose(stdin);
fclose(stdout);
return 0;
}