Cod sursa(job #92387)
Utilizator | Data | 15 octombrie 2007 10:26:35 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <stdio.h>
int num, cuv;
int main()
{
char c;
int ex = 0;
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while ( scanf("%c",&c) != EOF)
{
if ( ( c >= 'a' && c <= 'z') || ( c >= 'A' && c <= 'Z') )
num++, ex = 1;
else
{
if ( ex == 1)
cuv++;
ex = 0;
}
}
printf("%d", num / cuv );
return 0;
}