#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#define bool int
#define true 1
#define false 0
int main()
{
char a;
float n_words = 0;
float n_letters = 0;
float b;
bool inword = false;
printf("Please input charecter:");
while ((a = getchar()) != EOF)
{
if (!isspace(a) && !ispunct(a))
n_letters++;
if (!isspace(a) && !inword)
{
inword = true;
n_words++;
}
if (isspace(a) && inword)
inword = false;
}
printf("%.1fcharacters %.1fwords average is %.2f\n", n_letters, n_words, b = (n_letters / n_words));
system("pause");
return 0;
}
