Cod sursa(job #92388)
Utilizator | Data | 15 octombrie 2007 10:34:29 | |
---|---|---|---|
Problema | Text | Scor | 100 |
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++;
if ( ex == 0)
cuv++;
ex = 1;
}
else
ex = 0;
}
printf("%d", num / cuv );
return 0;
}