Name: Anonymous 2008-08-12 20:08
Write a program that takes a text file and converts adirectional quotes into `` and '', i.e.
INPUT:
OUTPUT:
Use whatever language you want. Bonus points for creativity and efficiency.
I'll start:
INPUT:
I turned my head around, with that casual smile all over my face.
"The stuff you said in your intro, how much of it was serious?"
With her arms crossed in front of her chest, lips sealed tight,
Suzumiya Haruhi kept her stern posture, staring right into my eyes.
"What 'stuff in my intro?'"
"The stuff about the aliens and all that."
"Are you an alien?"OUTPUT:
I turned my head around, with that casual smile all over my face.
``The stuff you said in your intro, how much of it was serious?''
With her arms crossed in front of her chest, lips sealed tight,
Suzumiya Haruhi kept her stern posture, staring right into my eyes.
``What 'stuff in my intro?'''
``The stuff about the aliens and all that.''
``Are you an alien?''Use whatever language you want. Bonus points for creativity and efficiency.
I'll start:
#include <stdio.h>
char *q[]= {"''", "``"};
main() {
int c, i=0;
while((c=getchar())!=EOF) {
if(c=='"')
printf("%s",q[i^=1]);
else
putchar(c);
}
}