#include "stdAfx.h"
#include "ctype.h"
#include "stdlib.h"
int main(void)
{
int ch,i=0,j=0;
float sum;
printf("Please enter a word the inspection of the average number of letters and words several letters\n");
printf("After input press CTRL + Z to calculate\n:");
while((ch=getchar())!=EOF)
{
if(ch>='A'&&ch<='z'||ch>='A'&&ch<='Z')
i++;
else if(ch==32)
j++;
}
sum=i/(j+1);
printf("Letters have %d\naverage number of letters have %0.2f\n",i,sum);
system("pause");
return 0;
}
![](https://img-my.csdn.net/uploads/201205/07/1336395374_7450.png)