Back to list of problems
TEX Quotes
272.c
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { int i; int num=1; while((i=getc(stdin))!=EOF) { if (i=='"') { if (num%2) { fputs("``", stdout); } else { fputs("''", stdout); } num++; } else { putc(i, stdout); } } exit(0); }