Pagini recente » Cod sursa (job #2984081) | Cod sursa (job #1992019) | Cod sursa (job #1829013) | Cod sursa (job #234615) | Cod sursa (job #331530)
Cod sursa(job #331530)
#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;
}