Cod sursa(job #569595)
Utilizator | Data | 1 aprilie 2011 19:25:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define NMAX 2100000
char c;
int Nr, L, i;
bool cuv;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while( !feof(stdin) )
{
scanf("%c", &c);
if( isalpha( c ) ) { ++L; cuv = true; }
else if( cuv ) { ++Nr; cuv = false; }
}
if( cuv ) ++Nr;
printf("%d\n", L/Nr );
return 0;
}