Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //272 - TEX Quotes
- #include<iostream>
- #include<string>
- using namespace std;
- int main(){
- string str;
- while(getline(cin, str)){
- string s;
- int i = 0,count = 0;;
- while(str[i] != '\0'){
- if(str[i] == '"'){
- count++;
- if(count > 1) {
- s+= "''";
- count = 0;
- i++;
- continue;
- }
- s += "``";
- i++;
- }
- else{
- s += str[i++];
- }
- }
- cout << s;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment