本帖最後由 曲書辰 於 2019-7-20 14:25 編輯
- #include<iostream>
- #include<sstream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- stringstream a;
- string b;
- int c=123;
- a<<c;
- a>>b;
- cout<<b<<endl;
- system("pause");
- return 0;
- }
複製代碼- #include<iostream>
- #include<sstream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- stringstream a;
- string b;
- int c=123;
- a<<c;
- a>>b;
- cout<<b+"456"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |