题目描述:https://pycoder.blog.csdn.net/article/details/124743820
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(void) {
char str[1000] = {0};
int size = 0;
int num = 0;
gets(str);
char* tmp = NULL;
tmp = strtok(str, " ");
size += strlen(tmp);
num++;
while (1) {
tmp = strtok(NULL, " ");
if (tmp == NULL) break;
size += strlen(tmp);
num++;
}
printf("%0.2f\n", (float)size / num);
return 0;
}