Cod sursa(job #331530)
| Utilizator | Data | 14 iulie 2009 12:38:26 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define NC 1024
int main( void )
{
char c;
char sep[] = " ,.?-!;:+=\t\n\r\f\v0123456789{}<>\"/\'\\@`~#%^&*()";
int nr = 0, l = 0, aux = 0;
freopen ( "text.in", "r", stdin );
freopen ( "text.out", "w", stdout );
while ( scanf("%c", &c ) != EOF )
{
if ( isalpha(c) )
{
nr++;
if ( aux == 0 )
l++;
aux = 1;
}
if ( strchr(sep, c) )
aux = 0;
}
// if ( l != 0 )
printf("%d", nr/l );
// else printf("0");
return 0;
}
