问题引入 使用scanf(“%s”,str)时,如果输入的字符串内有空格,会导致读入的字符串到空格直接结束。 解决方法 1. 使用gets函数 #include <stdio.h> int main() { char str[100]; gets(str); printf