prinf 函数格式化

<pre name="code" class="sql">例如:   %-7d  表示输出7位整数左对齐  
          %-10s 表示输出10个字符左对


printf ("%-10s%-6s%-2s
",a,b,c); 

表示 

a到b距离为10


b到c距离为6

c后面距离为2


printf ("%-10s%-6s%-2s%-5s
",a,b,c,d);

a到b距离为10


b到c距离为6

c到d距离为2

d后面距离5



                                    
原文地址:https://www.cnblogs.com/hzcya1995/p/13351733.html