# **[uva-272 TEX Quotes](https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=208)** --- ## **Input** Input will consist of several lines of text containing an even number of double-quote (") characters. Input is ended with an end-of-file character. ## **Output** The text must be output exactly as it was input except that: * the first " in each pair is replaced by two ` characters: `` and * the second " in each pair is replaced by two ' characters: ''. --- ## **Sample input** ``` "To be or not to be," quoth the Bard, "that is the question". The programming contestant replied: "I must disagree. To `C' or not to `C', that is The Question!" ``` ## **Sample output** ``` ``To be or not to be,'' quoth the Bard, ``that is the question''. The programming contestant replied: ``I must disagree. To `C' or not to `C', that is The Question!'' ``` --- ## **Solution:** ```c= #include <stdio.h> int main() { char ch ; int check = 1 ; while ( ( ch = getchar()) != EOF ) { if ( ch == '"' ) { if ( check == 1 ) { printf( "``" ) ; check = 2 ; } else { printf( "''" ) ; check = 1 ; } } else putchar( ch ) ; } return 0 ; } ``` ---