Cod sursa(job #693447)
| Utilizator | Data | 27 februarie 2012 12:41:40 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <stdio.h>
int main(){
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char c, cuvant=0;
int len = 0, nrCuv = 0;
while(scanf("%c", &c)!=EOF){
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){
++len;
if(cuvant == 0) {
++nrCuv;
cuvant = 1;
}
}
else {
cuvant = 0;
}
}
int med = len/nrCuv;
printf("%d", med);
return 0;
}