题解 | #字符串最后一个单词的长度#
字符串最后一个单词的长度
https://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char *str = (char*)calloc(5000, sizeof(char)); while(scanf("%s", str) != EOF){} printf("%d", strlen(str)); return 0; }