Cod sursa(job #857539)
Utilizator | Petcu Vlad Vlad.P | Data | 17 ianuarie 2013 22:21:20 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<stdio.h>
bool islet(char x){
if((x>='a'&&x<='z')||(x>='A'&&x<='Z')){
return true;
}
return false;
}
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char ch,last;
int l=0,c=0;
last='!';
while(scanf("%c",&ch)!=EOF){
if(islet(ch)==true){
++l;
if(islet(last)==false){
++c;
}
}
last=ch;
}
printf("%d\n",(l/c));
return 0;
}