Cod sursa(job #373193)
Utilizator | Data | 12 decembrie 2009 21:28:31 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<cstdio>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char c;
long long lg=0,nrc=0;
bool cuvant=true;
while(scanf("%c", &c)!=EOF)
{
int x=(int)c;
if ((x>=65 && x<=90) || (x>=97 && x<=122))
{
lg++;
if (cuvant)
{
nrc++;
cuvant=false;
}
}
else
cuvant=true;
}
printf("%lld",lg/nrc);
return 0;
}