#include<stdio.h>
int main()
{
int i = 5, j = 4;
printf("%0*d\n", i, j);
printf("%-10d\n", j);
return 0;
int main()
{
int i = 5, j = 4;
printf("%0*d\n", i, j);
printf("%-10d\n", j);
return 0;
}
执行结果:
00004
4