当前位置:网站首页>【码蹄集新手村 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;
}边栏推荐
- Onvif protocol related: 4.1.1 WS username token method to obtain wsusernametokenbean
- LeetCode 0565.数组嵌套:转换为图 + 原地修改の优化
- C语言进阶——字符函数和字符串函数
- sqli-labs(less-11)
- 【南瓜书ML】(task2)线性模型的数学推导(最小二乘估计、广义瑞利商、极大似然估计等)
- 语音通信网络的原理
- Nitrogen heterocyclic molecule modified uio-66-nh2 | polyethyleneimine modified uio-66-nh2| [email protected] @Zif67 nanomaterial
- How to upgrade Flink job gracefully?
- 【腾讯蓝鲸】第七届 7·24 运维日节日祝福送上~ 快来许愿~
- 协同工具协同办公的管理具有哪些痛点
猜你喜欢
[email protected] Nanocomposites | zif-8/ poly"/>MOF customized materials | bimetallic CuNi MOF nano materials | core-shell structure [email protected] Nanocomposites | zif-8/ poly

响应式织梦模板酒窖类网站

torch.utils.data.DataLoader说明

Computer dial-up Internet access

Li Kou 70 - climbing stairs - Dynamic Planning

onvif协议相关:3.1.1 Digest方式获取Authorization

The latest Jilin construction safety officer simulation question bank and answers in 2022

Onvif protocol related: 3.1.2 get the token list in digest mode

【腾讯蓝鲸】第七届 7·24 运维日节日祝福送上~ 快来许愿~

MOF customized materials | ultra thin MOF nanobelts | magnetic Fe3O4 @cd-mof nanocomposites | zif-8/ graphene composite nanoparticles
随机推荐
ArrayList underlying analysis
MySQL sort index failure?
Uio-66 | fe3o4/cu3 (BTC) 2 metal organic framework (MOF) nanocomposites supported on silver nanoparticles | nagdf4:yb, er upconversion nanoparticles @zif-8
Advanced C language -- character function and string function
ONVIF Protocol Related: 4.1.3 WS - username token Method get capture d'écran URL
Weekly summary (*65): planned output
torch. utils. data. Dataloader description
onvif协议相关:2.1.1 none方式获取token
XML文件解析
Supported metal organic framework zif-8 / graphene oxide hydrogen storage material | titanium dioxide /zif-8 composite | silicon dioxide @zif8 nano material
XML file parsing
[Yugong series] July 2022 go teaching course 012 forced type conversion
[record of question brushing] 13 Roman numeral to integer
onvif协议相关:3.1.3 Digest方式获取截图url
Wrong again, byte alignment and the use of pragma pack
LeetCode 0118. 杨辉三角
Galaxy Kirin V10 arm offline installation of portal
Transphorm的表面贴装封装产品系列增加行业标准TO-263 (D2PAK)封装产品,扩大SuperGaN平台的优势
[JS reverse crawler] - Youdao translation JS reverse practice
Azkaban 安装文档