Cod sursa(job #34493)
| Utilizator | Data | 20 martie 2007 20:28:30 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int nrw = 0, nrc = 0, ok = 0;
char c;
while(!feof(stdin))
{
scanf("%c", &c);
if(isalpha(c))
{
++nrc;
ok = 1;
}
else
{
if(ok)
{
++nrw;
ok = 0;
}
}
}
if(ok)
++nrw;
// printf("%d %d\n", nrc, nrw);
printf("%d\n", nrc / nrw);
return 0;
}
