我有这样的输出:
1569.3669
15968.3699
41.3878
587.5401
Run Code Online (Sandbox Code Playgroud)
但我希望输出像这样:
01569.3669
15968.3699
00041.3878
00587.5401
Run Code Online (Sandbox Code Playgroud)
我怎么能用C语言做到这一点?
printf("%010.4f", val);
Run Code Online (Sandbox Code Playgroud)
应该为你做,val是每个值.有关详情,请参阅此处
编辑:谢谢巴里.