%d
: As a normal output.
%2d
: 2 in width is output, the output right-aligned manner. If two is not enough, left the meeting spaces.
%02d
: 2 of the same width, alignment to the right. The median is not enough left 0s.
%.2d
: From the implementation point of view, with the same% 02d.
C language learning:% d, 2d, 02d, the difference .2d
Guess you like
Origin blog.csdn.net/wangzhongshun/article/details/101431554
Ranking