按行读入如果是string类型,则string s; getline(cin, s);如果是C字符串类型,则char str[256]; cin.getline(str, sizeof(str)); Last modification:November 7th, 2019 at 09:05 pm © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 Appreciate the author 支付宝微信