Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // input
- char c;
- // '' or ``
- int t = 0;
- // char, not string
- while (cin >> c)
- {
- if (c == '"')
- {
- cout << (t ? "''" : "``");
- // 1 -> 0, 0 -> 1
- t = 1-t;
- }
- else
- {
- // \n, space, or other
- cout << c;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement