随便写写,他的测试是过了的,但是可能有小问题。

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

int main(){

char* lastWord = malloc(sizeof(char)*100);


while(scanf("%s",lastWord) == 1);

int count = strlen(lastWord);


printf("%d\n",count);
free(lastWord);    
}