📜  将 int 向量转换为字符串 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.804000             🧑  作者: Mango

代码示例1
#include  // vector 
#include  // string stream 
#include  // ostream_iterator 
#include  // cout 
using namespace std;

int main()
{
    vector nums = {10, 7, 76, 415};
    stringstream result;
    copy(nums.begin(), nums.end(), std::ostream_iterator(result, ""));
    string n = result.str();
    cout << n;
}