Cod sursa(job #1220773)
Utilizator | Data | 18 august 2014 15:50:34 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<cstdio>
char lit(char c)
{
if((c<='z'&&c>='a')||(c<='Z'&&c>='A'))
return 1;
return 0;
}
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int nrl=0,nrc=0;
char c,c2='\n';
while(scanf("%c",&c)!=EOF)
{
if(lit(c)==1)
nrl++;
else
if(lit(c2)==1)
nrc++;
c2=c;
}
printf("%d\n",nrl/nrc);
return 0;
}