fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main()
  5. {
  6. char str[10000];
  7. while(gets(str)){
  8. int len=strlen(str);
  9. int work=0;
  10. for(int i=0; i<len; i++)
  11. {
  12. if(str[i]=='"')
  13. {
  14. work++;
  15. if(work%2==1)
  16. printf("``");
  17. else
  18. printf("''");
  19. }
  20. else
  21. printf("%c",str[i]);
  22. }
  23. printf("\n");
  24. }
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 4480KB
stdin
"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!"
stdout
``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!``