(1)% d, output according to the actual length of integer data.
(2) ⑵% MD, where m is the width of the specified output field, the number of data bits is less than m, and the left space is filled; If it is greater than m, it will be output according to the actual length.
(3)% LD, output long data (long)
2.o format characters, output octal integers (there is no sign, and he also takes the sign bit as a part of octal numbers).
(1)% o, refer to the explanation of% d.
⑵%lo, refer to the explanation of %ld.
(3)% mo, refer to the explanation of% MD.
3.x, X format characters, output hexadecimal integer.
It is also the interpretation of three kinds of reference% d.
4.u format characters, used to output unsigned data in decimal form.
5.c format characters, output a character.
6.s format characters, output a string.
(1)% s, such as printf("%s ","China ").
⑵%ms, the output string accounts for m columns, the length of the string is less than m, and the left space is filled, otherwise all strings are output.
(3)%-ms, if the string is less than m, the string is filled with spaces around m columns.
(4)% m.ns, the output occupies m columns, but only takes n characters at the left end of the string. These n characters are output on the right side of column M, and then the left side is filled with spaces.
5]%-m.ns, and put it on it, that is, N characters are output on the left side of column M, and spaces are filled on the right side. N>m, then m automatically takes the value of n, which not only ensures the normal output of n characters.
7.f format characters, used to output real numbers in decimal form.
(1)% f, all output, and output 6 decimal places.
(2)% m.nf, the output data * * * accounts for m columns, with n decimal places. If the data length is less than m, the left space is filled.
(3)%-m.nf, contrary to the above m.nf, left aligned and right filled with spaces.
8.e, e format symbols, output real numbers in exponential form.
(1)% e, the width and decimal places of the output data are not specified.
(2)% m.ne and %-m.ne, where n refers to decimal places.
9.g, G format symbols, used to output real numbers. It automatically selects F format or E format according to the numerical size, and does not output meaningless 0. This format is not used much.