Cod sursa(job #849165)
Utilizator | Data | 6 ianuarie 2013 17:18:32 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <stdio.h>
#include <ctype.h>
int main()
{
int words = 0, let = 0;
char ch;
bool isWord = false;
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while (scanf("%c", &ch) != EOF)
{
if (isalpha(ch))
let ++, isWord = true;
else
if (isWord)
words ++, isWord = false;
}
printf("%d", let / words);
return 0;
}