Cod sursa(job #237910)
| Utilizator | Data | 30 decembrie 2008 21:40:28 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<stdio.h>
long nrcuv,lung;
char x,prec;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
scanf("%c",&x);
if((x>='a'&&x<='z')||(x>='Z'&&x<='Z'))
{
lung++;
nrcuv=1;
}
while(!feof(stdin))
{
prec=x;
scanf("%c",&x);
if(((x>='a'&&x<='z')||(x>='Z'&&x<='Z')))
{
lung++;
if(!((prec>='a'&&prec<='z')||(prec>='Z'&&prec<='Z')))
nrcuv++;
}
}
printf("%ld",lung/nrcuv);
return 0;
}