|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include<stdio.h>
- int main()
- {
- printf("%10d\n",2020);
- printf("%010d\n",2020);
- printf("%10.2f\n",3.1416);
- printf("%-10.3f\n",3.1416);
- printf("%10e\n",520000);
- printf("%-10E\n",510000);
- return 0;
- }
复制代码
这个为什么输出是
2020
0000002020
3.14
3.142
3.141600e+00
3.141600E+00
然后修改一下代码:- #include<stdio.h>
- int main()
- {
- printf("%10d\n",2020);
- printf("%010d\n",2020);
- printf("%10.2f\n",3.1416);
- printf("%-10.3f\n",3.1416);
- printf("%10e\n",520000.0);
- printf("%-10E\n",510000);
- return 0;
- }
复制代码
输出变为:
2020
0000002020
3.14
3.142
5.200000e+05
5.200000E+05
|
|