#include #include #include using namespace std; //main int main() { cout << quoted("hello \"world\"") << '\n'; string str = "hello 'world'"; cout << quoted(str, '\'', '%') << '\n'; cin >> quoted(str); // 1 cin.ignore(100, '\n'); cout << "1: " << str << '\n'; cin >> quoted(str, '\''); // 2 cin.ignore(100, '\n'); cout << "2: " << str << '\n'; } // input // "hello \"world\"" // 'hello \'world\'' // output: // "hello \"world\"" // 'hello %'world%'' // 1: hello "world" // 2: hello 'world' //=