If the data width is not enough, it will be filled with spaces on the left by default, and it will be automatically expanded if it exceeds the set width.
2."0"? adjunct
Use zero as padding
3. "-"modifier
Data items are aligned to the left in the range, and data items are output from the leftmost position of the range.
4."+"
Output another plus sign.
Note: When "0" and width modifier are added after "-"is modified, zero will not be added to the right side of the data (the "0" modifier will be invalid at this time).
To sum up, there are generally two usages:
printf("%-8ld\n ",num);
printf("%08ld\n ",num);
As shown in the figure below:
The success of enterprise management depends on three factors: honesty is the essential quality of enterprise managers; Honesty is