当前位置:网站首页>printf函数-转换说明
printf函数-转换说明
2022-07-23 10:47:00 【Blue_lan18】
- 转换说明%4d将以-123的形式显示数123;转换说明%-4d将以123-的形式显示123。(-代表空格)
# include <stdio.h>
int main()
{
printf("0123456789\n");
printf("%10d\n", 1234);
printf("%-10d\n", 1234);
return 0;
}
- e——表示指数(科学记数法)形式的浮点数。
- f——表示“定点十进制”形式的浮点数。
- g——表示指数形式或者定点十进制形式的浮点数,形式的选择根据数的大小决定。如果要显示的数值没有小数点后的数字,g就不会显示小数点。但是,在显示非常大或非常小的数时,说明符g会转换成指数形式以便减少所需的字符数。
# include <stdio.h> int main() { int i; double x; i = 40; x = 839210; printf("|%d|%5d|%-5d|%5.4d|\n", i, i, i, i); //printf("|%10.3f|%10.4e|%-10g|\n", x, x, x); printf("%10.4e\n", x); return 0; }
边栏推荐
- Application of ERP management system in equipment manufacturing enterprise management
- ESP三相SVPWM控制器的simulink仿真
- centos7 中彻底卸载mysql
- Common SQL of Oracle Report
- Safe operation 7.22
- 报错 | cannot read property ‘_normalized‘ of undefined
- IDEA 提高效率的5大免费插件
- STL map操作
- Unreal中通过FMonitoredProcess启动其他独立程序
- Time series data in industrial Internet of things
猜你喜欢

The current situation and history of it migrant workers

Matlab simulation of Turbo code error rate performance

BGP联邦实验

基于PSO优化的多目标最优值求解matlab仿真

上小学之前要学会的本领指引

Time series data in industrial Internet of things

深入理解L1、L2正则化

用rpm -e --nodeps进行批量删除

Cloud native observability tracking technology in the eyes of Baidu engineers
![[CTFHub]JWT 的头部和有效载荷这两部分的数据是以明文形式传输的,如果其中包含了敏感信息的话,就会发生敏感信息泄露。试着找出FLAG。格式为 flag{}](/img/d0/133d628a304f5c6b5f0d514c9fe222.jpg)
[CTFHub]JWT 的头部和有效载荷这两部分的数据是以明文形式传输的,如果其中包含了敏感信息的话,就会发生敏感信息泄露。试着找出FLAG。格式为 flag{}
随机推荐
Les raccourcis clavier liés à l'onglet ne peuvent pas être utilisés après la mise à jour du vscode
pytorch opencv pil图像预处理比较
Error | cannot read property '_ normalized‘ of undefined
C# 计算某个字符在字符串中出现的次数
Part III detailed explanation of RBAC authority management database design
uniapp实现横向点击滑动菜单
Safety 7.18 operation
深入理解CAS (自旋锁)
报错 | cannot read property ‘_normalized‘ of undefined
Camera 手电筒修改
it 农民工的现状和历史
[heuristic divide and conquer] the inverse idea of heuristic merging
信号量
800V高压快充落地进程加快均胜电子获5亿欧元项目定点
[solve the exception] Flink uploads the jar package to the cluster environment, and the operation report does not serialize the exception
数据治理浅析
Skills to learn before going to primary school
VSCode的感叹号+tab的快捷键不能用,以及A-SOUL-live2d插件出问题的解决方法
ClickHouse,让查询飞起来!!!
第三篇 RBAC权限管理 数据库设计详解