原创 c/c++中gets()的替代用法

get()在應用中開始被禁用(例如PAT),而scanf()只能輸入一段字符串(不含空格),這就使得有一些特定的輸入很難完成。 以下是替代的方法: 一、 string str; getline(cin,str); 二、 ch