%d, output according to the actual length of integer data. %ld, output long integer data.
Extended data
1, o format, output octal integer.
2.x format characters, and output integers in the form of hexadecimal numbers.
3. The symbols in U format are used to output unsigned data, that is, unsigned numbers, which are output in decimal form.
4, C format characters, used to output a character.
5, s format characters, used to output a string.
6.F format symbols are used to output real numbers (including single precision and double precision) and output them in decimal form.
7, E format symbols, output real numbers in exponential form.
8.G format symbols are used to output real numbers. According to the size of the numerical value, F format or E format is automatically selected (the selected output is the one with smaller width), and meaningless zeros are not output.
9.p format characters are used for the output of variable addresses.
Baidu Encyclopedia-Format Characters