当前位置:网站首页>【码蹄集新手村 600 题】输出时的左对齐,右对齐
【码蹄集新手村 600 题】输出时的左对齐,右对齐
2022-07-17 18:23:00 【Sandm *】
题目链接:
解题思路:
这里以 %nd 为例,
- 所谓左对齐,即 %-nd,
即多行不同的数字同时向左为基准对齐,行与行之间的数字对齐通过空格来实现自动补齐
- 右对齐,即 %nd
即多行不同的数字以最右边为基准对齐
注意:
其中的 %nd 与 %m.nf
中的宽度与精度都必须是常量,不能是变量
参考代码:
#include<bits/stdc++.h>
using namespace std;
int main( )
{
double a = 3.141593,b = 22.345600;
printf("%-14lf %14lf\n",a,a);//不要忘记是 %lf 不是 %d
printf("%-14lf %14lf",b,b);
return 0;
}边栏推荐
- Unveiling secrets of matrixcube 101 - functions and architecture of matrixcube
- Advanced C language -- character function and string function
- XML modeling (easy to learn)
- 【刷题记录】13. 罗马数字转整数
- 【南瓜书ML】(task2)线性模型的数学推导(最小二乘估计、广义瑞利商、极大似然估计等)
- [error record /selectpicker] the display position of dropdown menu is offset
- onvif协议相关:3.1.4 Digest方式获取流地址
- MOF customized materials | bimetallic CuNi MOF nano materials | core-shell structure [email protected] Nanocomposites | zif-8/ poly
- Method of converting video format to ffmpeg and exporting GIF dynamic graph
- 如何在MFC中添加一个线程
猜你喜欢

Attachment handling of SAP Fiori

onvif协议相关:2.1.1 none方式获取token

LeetCode 0118. 杨辉三角

LeetCode 0565.数组嵌套:转换为图 + 原地修改の优化

Onvif protocol related: 2.1.1 get token in none mode

松下A6伺服驱动器外部绝对值光栅尺全闭环参数设置

Chitosan coated pcn224 nanoparticles | metal organic skeleton fe-mil-88nh2 | nickel based MOF material (Ni MOF / NF)

【码蹄集新手村 600 题】格式化的输入输出,使用 0 来代替补全的空格

565.数组嵌套

关于TCP/IP协议漏洞的安全措施
随机推荐
【腾讯蓝鲸】第七届 7·24 运维日节日祝福送上~ 快来许愿~
Qiyue supplies cumof nanocrystals loaded with methylene blue | femof nanosheets grown in situ on foam nickel | oxide nanowires /zif MOFs sugar gourd like Composites
npm err! ant-design- [email protected] build: `umi build`
Attachment handling of SAP Fiori
Gold nanoparticles modified mil-101 framework material (AuNPs / mil-101) / loaded cof-tppa-1 (Au NPs / cof-tppa-1) | Qiyue reagent
Metal organic framework material / polymer composite zif-8/p (TDA co HDA) | zinc oxide [email protected] (FE) composite nan
Force buckle 64 minimum path sum -- Introduction to dynamic programming
Three methods of realizing network request in pyodide
The latest Jilin construction safety officer simulation question bank and answers in 2022
XML文件解析
Li Kou 413 division of equal difference sequence dynamic programming
565.数组嵌套
Advanced C language -- character function and string function
Fluorine modified uio-66 | 3,4-dihydroxybenzaldehyde modified uio-66-nh2 | camptothecin derivative / oligopeptide @zif-8 nano drug carrier system
onvif协议相关:2.1.3 none方式获取流地址
Responsive Zhimeng template logistics and freight service website
Azkaban installation documentation
【码蹄集新手村 600 题】格式化的输入输出,使用 0 来代替补全的空格
perl 命令批量替换文件中的一些内容
onvif协议相关:3.1.1 Digest方式获取Authorization