读取一行多个字符串的方法

while(getline(cin,line))
	{
		string x;
		flag1++;
		flag2=0;
		stringstream ss(line);
		while(ss>>x)
		{
			cout<<x<<' ';
			flag2++;
			t[flag1][flag2]=x;
		}
		cout<<endl;
	}

撒花~

原文地址:https://www.cnblogs.com/ShineEternal/p/10834251.html