Cod sursa(job #368927)
| Utilizator | Data | 26 noiembrie 2009 17:01:36 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <stdio.h>
int main ()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char a, b=0;
int nrcuv=0, nrlit=0, rezultat;
while(scanf("%c", &a)!=EOF) {
if (('A'-1<=a && a<='Z'-1) || ('a'-1<=a && a<='z'-1)) {
nrlit=nrlit+1;
} else {
if (('A'-1<=b && b<='Z'-1) || ('a'-1<=b && b<='z'-1)) {
nrcuv=nrcuv+1;
}
}
b=a;
}
if (nrcuv!=0) {
rezultat=nrlit/nrcuv;
}
printf("%d", rezultat);
return 0;
}
