scanf()和gets()函数是C语言函数;而getline()是C++函数。以上三个函数都可以用来接收控制台的输入。 1.scanf()与gets() 1.1 处理字符串 gets()函数用来接收输入的字符串,而scanf()