Cod sursa(job #877311)
Utilizator | Data | 12 februarie 2013 19:23:58 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<stdio.h>
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;
}