This commit is contained in:
Павел Родионов
2025-11-13 18:21:23 +07:00
parent e266a25b45
commit 2fca7b75f5
28 changed files with 74 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
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;
}