宽度说明符:
given: printf('|%5d|', 1);
prints: | 1|
^^^^^-- 4 spaces + 1 char = width of 5
Run Code Online (Sandbox Code Playgroud)
对准:
given: printf('|%-5d|', 1);
prints |1 |
^^^^^-- 1 char + 4 right-justified spaces = width of 5.
Run Code Online (Sandbox Code Playgroud)