Cod sursa(job #81765)
| Utilizator | Data | 4 septembrie 2007 11:50:49 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#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;
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;}
}
printf("%ld", bnr/sznr);
fclose(stdin);
fclose(stdout);
return 0;
}
