Pagini recente » Cod sursa (job #3247484) | Cod sursa (job #2874553) | Cod sursa (job #1002674) | Cod sursa (job #2593225) | Cod sursa (job #1198071)
#include<cstdio>
#include<cstring>
using namespace std;
int letters,words;
char S[10000010],*p;
bool isLetter(char C)
{
if(C>='a' && C<='z')return true;
if(C>='A' && C<='Z')return true;
return false;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fgets(S,10000010,stdin);
for(p = S; *p; p++)
{
if(isLetter(*p))letters++;
if(p==S && letters == 1)words++;
if(p==S)continue;
if(isLetter(*p) && !isLetter(*(p-1)))words++;
}
printf("%d\n",letters/words);
return 0;
}