Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language problems, please master help.
C language problems, please master help.
First of all, you should know that 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 in ASCII code are adjacent to each other, that is, if 9 and 6 are regarded as character forms, then subtracting them will also get 3 (the former subtracts the latter, the shaping of character' 9' is 39, and the shaping of character' 6' is 36).

Then let's analyze the program content:

When' 2' is entered, because CS is an integer, getchar () automatically converts the character' 2' into an integer (32 after conversion). Since CS is not equal to the carriage return value, execute the switch () statement: since CS is an integer value' 2', subtracting' 2' is equal to 0 (the computer first converts' 2' into an integer in the subtraction process). But it uses a: with Case 1 * *, so the output is putchar(cs+4), that is, putchar (36). The Putchar statement is output as characters, and 36 is converted into' 6'. If there is no break before case 2, then Case 2 will continue to execute, output a' 6' again, and break will jump out of the switch () statement;

Inferred from the above ideas: input' 4' to get' 8', input' 7' to get the character' 9' of putchar(cs+2), and input' 3' to get' 77';

To sum up, the answer is: 668977

The procedure is correct. If there is an error during debugging, delete the debugging folder and debug again! Or re-debug in another disk!