// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <vector>
#include <numeric>

using std::string;
using std::vector;
using std::cout;
using std::endl;

string join(vector<string> elements, string seperator)
{
    string res = "";
    for(int i = 0; i < elements.size(); i++)
    {
        if(i > 0) res += seperator;
        res += elements[i];
    }
    return res;
}

int main(int argc, char* argv[])
{
    vector<string> strings = { "Hello", "World", ",", "Oh", "Wait", "no", "the", "world", "is", "on", "fire" };
    cout << join(strings, string(" ")) << endl;
    return 0;
}
