Background: Write a mock up today for 10 hours, still not fruit, so water this topic to be happy.
Train of thought: one-by-one read, the quotation marks are exchanged interchangeably with the specified quotation marks.
Learn:
1. Special quotes Here are special characters that are not character with the 255-character ASCII table, so they can only be exported as string constants.
2. The sense of simplicity of conditional expression.
3.
<span style= "FONT-SIZE:18PX;" > (Temp=getchar ()). =eof//brackets cannot be omitted. </span>
Operator Precedence: The relational operator is greater than the logical budget character greater than the copy operator, and the comma is the smallest.
4.gets to read almost unlimited strings, so C11 has been canceled, preferably not to use. But scanf a space or tab will stop reading the string, so use GetChar (), pay attention to details.
5. Carriage return line break, under Windows is ' \ n ', ' \ R ' under Linux is ' \ n ' and under MacOS is ' \ R ' under Windows GetChar Read Only ' \ n ', while on Linux first ' \ r ' and then ' \ n '.
My Code:
#include <stdio.h>
int main (void) {
char temp;
BOOL Key=true;
while ((Temp=getchar ())!=eof) {
if (temp!= ' ") printf ("%c ", temp);
else{
printf ("%s", key?) ``":"''");
Key=!key
}
}
return 0;
}