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

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

撒花~

posted @ 2019-02-08 09:46  ShineEternal  阅读(215)  评论(0编辑  收藏  举报