%后面+数字就行了. 如: int a; a=5; printf("%10d",a); 浮点数加2个数用"."分开 如: float a; a=5.2; printf("%10.2f",a); 就是域宽10,2位小数