Pagini recente » Cod sursa (job #1545806) | Rating MihaiPopescu (mihaipopescu1999) | Cod sursa (job #143197) | Cod sursa (job #1580898) | Cod sursa (job #613134)
Cod sursa(job #613134)
#include <cstdio>
#include <cstring>
using namespace std;
#define maxn 2000000
int n, i, j, k, cs, lg, nr;
char s[maxn];
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
fgets(s, maxn, stdin);
n=strlen(s);
for(int i=0; i<n; ++i)
{
if((s[i]>='a' && s[i]<='z') || (s[i]>='A' && s[i]<='Z'))
{
++lg;
if(!cs)
{
++nr;
cs=1;
}
}
else
cs=0;
}
printf("%d\n", lg/nr);
return 0;
}