Cod sursa(job #857538)
| Utilizator | Data | 17 ianuarie 2013 22:20:53 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| 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("last.in","r",stdin);
freopen("last.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;
}
