题解 | #字符串最后一个单词的长度#
字符串最后一个单词的长度
https://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
#include <stdio.h> #include<string.h> int main() { char str[1000][100]; int i = 0; while (scanf("%s", str[i] ) != EOF) { i++; } int len ; len = strlen(str[i - 1]); printf("%d" , len); return 0; }