题意先匹配第一关键字再匹配第二关键字容易误导,一起匹配就好了。 先判断第二关键字是否为空 #include <stdio.h> #include <string.h> #define SIZE 20 const char *result[7] = { "unknown command","reset what","board fault","where to add", ...