#include <iostream>
#include <string>
using namespace std;
class MyString
{
std::string value;
public:
MyString& operator,(const string& c)
{
value += c + ' ';
return *this;
}
friend ostream& operator<<(ostream& o, const MyString& s)
{
o << s.value;
return o;
}
};
int main()
{
cout << (MyString(), "hi", "codeisc", "!") << endl;
cout << (MyString(), "hi", "codeisc", '?', "oh no! what happened?") << endl;
cin.get();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgTXlTdHJpbmcKewogICAgc3RkOjpzdHJpbmcgdmFsdWU7CiAgICAKcHVibGljOgogICAgTXlTdHJpbmcmIG9wZXJhdG9yLChjb25zdCBzdHJpbmcmIGMpCiAgICB7CiAgICAgICAgdmFsdWUgKz0gYyArICcgJzsKICAgICAgICByZXR1cm4gKnRoaXM7CiAgICB9CgogICAgZnJpZW5kIG9zdHJlYW0mIG9wZXJhdG9yPDwob3N0cmVhbSYgbywgY29uc3QgTXlTdHJpbmcmIHMpCiAgICB7CiAgICAgICAgbyA8PCBzLnZhbHVlOwogICAgICAgIHJldHVybiBvOwogICAgfQp9OwoKaW50IG1haW4oKQp7CiAgICBjb3V0IDw8IChNeVN0cmluZygpLCAiaGkiLCAiY29kZWlzYyIsICIhIikgPDwgZW5kbDsKICAgIGNvdXQgPDwgKE15U3RyaW5nKCksICJoaSIsICJjb2RlaXNjIiwgJz8nLCAib2ggbm8hIHdoYXQgaGFwcGVuZWQ/IikgPDwgZW5kbDsKCiAgICBjaW4uZ2V0KCk7CiAgICByZXR1cm4gMDsKfQ==