#include <stdio.h> int main(void) { int year = 05; printf("%09d\n",year); printf("%9d\n",year); printf("%.9d\n",year); return 0; }
输出结果:
000000005
________5
000000005
测试环境:
操作系统:Windows7(32位)
编译软件:Code::Blocks 10.05
#include <stdio.h> int main(void) { int year = 05; printf("%09d\n",year); printf("%9d\n",year); printf("%.9d\n",year); return 0; }
输出结果:
000000005
________5
000000005
测试环境:
操作系统:Windows7(32位)
编译软件:Code::Blocks 10.05
转载于:https://www.cnblogs.com/AndyHoo/archive/2012/07/13/2590941.html