Pagini recente » Cod sursa (job #200279) | Statistici Ostafi Leonard (ostafileonard) | Statistici Ignat Gabriel (Gabi_Ignat) | Cod sursa (job #1990652) | Cod sursa (job #81768)
Cod sursa(job #81768)
#include <stdio.h>
#include <ctype.h>
int i, ii, j;
char ch;
long nr;
long sznr, bnr;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
i=0;
ii=0;
bnr=0;
while (!feof(stdin))
{
scanf("%c", &ch);
if (isalpha(ch)) {i=1;j=0;ii=1;}
else {i=0;j=1;}
if (i) {nr++;}
if (ii && !i && j) {sznr++;ii=0;bnr+=nr;nr=0;}
}
if (nr>1) bnr+=nr;
printf("%ld", bnr/sznr);
fclose(stdin);
fclose(stdout);
return 0;
}