Cod sursa(job #201755)
| Utilizator | Data | 3 august 2008 15:15:23 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<cstdio>
#include<cstring>
char s[100000];
long i,l,lung,nr;
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fgets(s,100000,stdin);
for(i=0;i<=(long)strlen(s);i++)
if((s[i]>='a' && s[i]<='z')||(s[i]>='A' && s[i]<='Z'))
l++;
else if(l>0){
lung+=l;
nr++;
l=0;
}
if(l>0){
lung+=l;
nr++;
}
printf("%ld\n",(long)(lung/nr));
fclose(stdin);
fclose(stdout);
return 0;
}
