Cod sursa(job #956)
Utilizator | Data | 12 decembrie 2006 12:06:16 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <stdio.h>
int main()
{
int lit = 0, cuv = 0, ok = 0;
char c;
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while(!feof(stdin))
{
scanf("%c", &c);
if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))
{
++lit;
ok = 1;
}
else if (ok)
{
++cuv;
ok = 0;
}
}
if (ok)
++cuv;
printf("%d\n", lit / cuv);
return 0;
}