Cod sursa(job #608808)
Utilizator | Data | 18 august 2011 12:24:16 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 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;
}
}
printf("%d", litere/cuvinte);
return 0;
}