Skip to content

Instantly share code, notes, and snippets.

@TheoKlein
Created August 10, 2016 11:01
Show Gist options
  • Select an option

  • Save TheoKlein/fab8f19dfb89aba6b8a3cf24bc4ef013 to your computer and use it in GitHub Desktop.

Select an option

Save TheoKlein/fab8f19dfb89aba6b8a3cf24bc4ef013 to your computer and use it in GitHub Desktop.
ZeroJudge c007
#include <iostream>
#include <string>
using namespace std;
int main () {
string input;
bool quote = false;
while( getline(cin , input) ){
for(int i = 0 ; i < input.length() ; ++i){
if(input[i] == '"'){
if(quote){
cout << "''";
quote = false;
}else{
cout << "``";
quote = true;
}
}else{
cout << input[i];
}
}
cout << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment