/* Problem 2--TeX Quotes This was certainly the easiest problem in the contest. There was nothing particularly onerous about this problem. */ #include #include using namespace std; ifstream in ("prob2.in"); ofstream out ("prob2.out"); int main (int argc, char **argv); int main (int argc, char **argv) { char l[10000]; //We don't know how long the lines are, but we do know //that the file itself can't exceed 10000 characters. bool q = true; //If q is true, we print ``, if false we print ''. while (true) { in.getline (l,sizeof l); if (strcmp (l,"END")==0) break; for (int c=0;l[c]!=0;c++) if (l[c]=='\"') { //If it's a quote, we process it. out << (q ? "``" : "\'\'"); q = !q; } else out << l[c]; out << endl; } return 0; }