Skip to content

Instantly share code, notes, and snippets.

@peter279k
Created December 22, 2015 02:01
Show Gist options
  • Save peter279k/a4e1f1e5b4bd227e2a6f to your computer and use it in GitHub Desktop.
Save peter279k/a4e1f1e5b4bd227e2a6f to your computer and use it in GitHub Desktop.
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
boolean check = false;
while(input.hasNext()) {
String str = input.nextLine();
for(int i=0;i<str.length();i++) {
if(str.charAt(i) == '\"') {
if(check) {
check = false;
System.out.print("\'\'");
}
else {
check = true;
System.out.print("``");
}
}
else {
System.out.print(str.charAt(i));
}
}
System.out.println();
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment