当前位置:网站首页>Electronic Society C language level 1 29, alignment output
Electronic Society C language level 1 29, alignment output
2022-06-26 22:46:00 【dllglvzhenfeng】
Electronics Association C Language 1 level 29 、 Align output
C++ Code Method 1
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a, b, c;
cin >> a >> b >> c;
cout << setiosflags(ios::right) << setw(8) << a << " "
<< setiosflags(ios::right) << setw(8) << b << " "
<< setiosflags(ios::right) << setw(8) << c << endl;
return 0;
}
C++ Code Method 2
/*
Electronics Association C Language 1 level 29 、 Align output Method 1
http://noi.openjudge.cn/ch0101/03/
Read in three integers , Per integer 8 The width of characters , Align them right and output them .
Input
There is only one line , Contains three integers , Integers are separated by a space .
Output
There is only one line , Output three integers in sequence according to the format requirements , Separated by a space .
The sample input
123456789 0 -1
Sample output
123456789 0 -1
*/
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
printf("%8d %8d %8d",a,b,c);
return 0;
}Electronics Association C Language 1 level 29 、 Align output Method 3
/*
Electronics Association C Language 1 level 29 、 Align output Method 3
http://noi.openjudge.cn/ch0101/03/
Read in three integers , Per integer 8 The width of characters , Align them right and output them .
Input
There is only one line , Contains three integers , Integers are separated by a space .
Output
There is only one line , Output three integers in sequence according to the format requirements , Separated by a space .
The sample input
123456789 0 -1
Sample output
123456789 0 -1
*/
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<setw(8)<<a<<" "<<setw(8)<<b<<" "<<setw(8)<<c<<endl;
return 0;
}Electronics Association C Language 1 level 29 、 Align output Method four
/*
Electronics Association C Language 1 level 29 、 Align output Method four
http://noi.openjudge.cn/ch0101/03/
Read in three integers , Per integer 8 The width of characters , Align them right and output them .
Input
There is only one line , Contains three integers , Integers are separated by a space .
Output
There is only one line , Output three integers in sequence according to the format requirements , Separated by a space .
The sample input
123456789 0 -1
Sample output
123456789 0 -1
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%8d %8d %8d\n",a,b,c);
return 0;
}python3 Code
"""
1.1 Input and output of programming basis 03 Align output
http://noi.openjudge.cn/ch0101/03/
https://blog.csdn.net/yigezzchengxuyuan/article/details/86582640
"""
a, b, c = map(int, input().split())
print(format(a, '>8'), format(b, '>8'), format(c, '>8'))Electronics Association Youth software programming level test C Language over the years
Electronics Association C Language Real and simulated questions
Electronics Association C Language 1 level 5 、 Judge whether it can be 3 ,5 ,7 to be divisible by
Electronics Association C Language 1 level 6 、 Cycling and walking
Electronics Association C Language 1 level 7 、 Draw a rectangular
Electronics Association C Language 1 level 18 、 Calculate postage
Electronics Association C Language 1 level 19 、 Find the sum and mean of integers
Electronics Association C Language 1 level 21 、 The problem of logical judgment Enter three numbers a,b,c, The largest output
Electronics Association C Language 1 level 23 、 Judge the average leap year
Electronics Association C Language 1 level 24 、 Find the greatest common divisor
Electronics Association C Language 1 level 28 、 Character diamond
Electronics Association C Language 1 level 29 、 Align output
边栏推荐
- Brief analysis of the self inspection contents of the blue team in the attack and defense drill
- nmap参数详解
- Leetcode (763) -- dividing letter ranges
- leetcode:710. Random numbers in the blacklist [mapping thinking]
- Do an online GIF synthesis service at no cost
- Solution of valuenotifier < list < t > > monitoring problem in fluent
- JupyterLab 常用配置
- MATLAB and MySQL database connection and data exchange (based on ODBC)
- curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
- [Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!
猜你喜欢

Flashtext, a data cleaning tool, has directly increased the efficiency by dozens of times

數據清洗工具flashtext,效率直接提昇了幾十倍數

Bs-gx-016 implementation of textbook management system based on SSM
![[mathematical modeling] spanning tree based on Matlab GUI random nodes [including Matlab source code 1919]](/img/0c/17efaaa2488451b6dd15d9db33eba7.jpg)
[mathematical modeling] spanning tree based on Matlab GUI random nodes [including Matlab source code 1919]

leetcode:6107. 不同骰子序列的数目【dp六个状态 + dfs记忆化】

LabVIEW Arduino tcp/ip remote smart home system (project part-5)
![Flower shop window layout [dynamic planning]](/img/d9/6b8f9cd0f74e70b313d2571c2ded30.png)
Flower shop window layout [dynamic planning]

Yolov6: un cadre de détection de cibles rapide et précis est Open Source
![leetcode:6103. Delete the minimum score of the edge from the tree [DFS + connected component + value record of the subgraph]](/img/16/8dc63e6494b3f23e2685e287abc94c.png)
leetcode:6103. Delete the minimum score of the edge from the tree [DFS + connected component + value record of the subgraph]

Product design in the extreme Internet Era
随机推荐
Leetcode (122) - the best time to buy and sell stocks II
[mixed programming JNI] Part 6: operation of strings and arrays in native
Parsing complex JSON in fluent
DLA model (classification model + improved segmentation model) + deformable convolution
L'outil de nettoyage des données flashtext améliore directement l'efficacité de plusieurs dizaines de fois
JupyterLab 常用配置
Share three methods of automatic summation in Excel
【混合编程jni 】第十一篇之JNA详情
Bs-gx-016 implementation of textbook management system based on SSM
[mixed programming JNI] Part 7: JNI command lines
Restfultoolkitx of idea utility plug-in -- restful interface debugging
curl: (35) LibreSSL SSL_ connect: SSL_ ERROR_ SYSCALL in connection
论文解读(LG2AR)《Learning Graph Augmentations to Learn Graph Representations》
Module externe unity3d anyportrait 2D Skeleton Animation
LabVIEW Arduino tcp/ip remote smart home system (project part-5)
在线协作文档综合评测 :Notion、FlowUs、Wolai、飞书、语雀、微软 Office、谷歌文档、金山文档、腾讯文档、石墨文档、Dropbox Paper、坚果云文档、百度网盘在线文档
Briefly describe the model animation function of unity
开放世界机甲游戏-Phantom Galaxies
Detailed explanation of nmap parameters
在哪个平台买股票开户最安全?求分享