Cod sursa(job #608806)
Utilizator | Data | 18 august 2011 12:16:05 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <stdio.h>
int main()
{
char c;
int litere=0,cuvinte=0,k=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++;
if(k == 1)
{
cuvinte++;
k = 0;
}
}else
k = 1;
}
printf("%d", litere/cuvinte);
return 0;
}