#include <iostream>
#include <sstream>
using namespace std;
int main()
{
int n;
float f;
string s;
string st = "1 .3 666";
istringstream t(st);
stringstream t1;
t>>n;
t>>f;
t>>s;
t1<<n<<endl<<f<<endl<<s;
cout<<n<<endl;
cout<<f<<endl;
cout<<s<<endl;
cout<<t1.str();
return 0;
}
/*
istringstream 字符串输入流,提供读string功能
ostringstream 字符串输出流,提供写string功能
stringstream 字符串输入输出流,提供读写string功能
*/
#include <sstream>
using namespace std;
int main()
{
int n;
float f;
string s;
string st = "1 .3 666";
istringstream t(st);
stringstream t1;
t>>n;
t>>f;
t>>s;
t1<<n<<endl<<f<<endl<<s;
cout<<n<<endl;
cout<<f<<endl;
cout<<s<<endl;
cout<<t1.str();
return 0;
}
/*
istringstream 字符串输入流,提供读string功能
ostringstream 字符串输出流,提供写string功能
stringstream 字符串输入输出流,提供读写string功能
*/