#include #include #include int main() { setlocale(LC_ALL, ""); float ch = 0,words = 0,o = 0; wchar_t x; while((x = getwchar()) != WEOF){ switch(x){ case ' ': ch += o; if(o>0) words++; o = 0; break; default: o++; } } printf("\nch per word - %.2f\n",ch/words); return 0; }