字符串多组输入,直到遇到回车结束输入

在某论坛看到的某大神的写法,学到了学到了!!

    string s;
    while(getline(std::cin,s)&&!s.empty()){
        
    }
    char s[maxn];
	while(gets(s)&&strcmp(s,"")!=0){}

猜你喜欢

转载自blog.csdn.net/chenyume/article/details/81587831