Cod sursa(job #203120)
| Utilizator | Data | 13 august 2008 22:49:12 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<cstdio>
#include<cstring>
char chr;
long i,l,lung,nr;
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c",&chr)!=EOF)
if((chr>='a' && chr<='z')||(chr>='A' && chr<='Z')){
lung++;
if(l==0)nr++;
l++;
}
else
l=0;
if(l>0){
lung+=l;
nr++;
}
if(nr==0)printf("0\n");
else printf("%ld\n",(long)(lung/nr));
fclose(stdin);
fclose(stdout);
return 0;
}
