scanf(“%[^\n]“,str)与gets(str)的区别 用scanf("%[^],str);时结尾换行符不会吃掉,会给下一个输入留下,而gets会吃掉结尾换行符。所以在用scanf("%[^],str);时后面要带个getchar();