使用printf()设置输出字段长度 printf(“%*s”,name); 星号可以直接替换为int型常量,如printf(“%6s”,name); 也可以用这种方法 printf(“%*s”,10,name); posted on 2018-03-01 08:48 南邮21栋 阅读( ...) 评论( ...) 编辑 收藏 转载于:https://www.cnblogs.com/hhjfighting/p/8486712.html