Cod sursa(job #608812)
| Utilizator | Data | 18 august 2011 12:34:53 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <stdio.h>
int main()
{
char c;
int litere=0,cuvinte=0,h=0;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c", &c) != EOF)
{
if(c >= 'a' && c <= 'z' || c>='A' && c<= 'Z')
{
litere++;
h=1;
}
else if(h==1)
{
cuvinte++;
h=0;
}
}
if(h == 1)
cuvinte++;
printf("%d", litere/cuvinte);
return 0;
}
