当前位置:网站首页>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
边栏推荐
- 主从复制系统设计
- vulnhub之dc8
- 【Kotlin】关键词suspend 线程操作的学习和async理解
- Which platform is the safest for buying stocks and opening accounts? Ask for sharing
- LabVIEW Arduino tcp/ip remote smart home system (project part-5)
- 这个算BUG吗?乱填的字母是否可以关闭
- 【混合编程jni 】第九篇之Jni总结
- Briefly describe the model animation function of unity
- leetcode - 买卖股票的最佳时机
- 數據清洗工具flashtext,效率直接提昇了幾十倍數
猜你喜欢

【数学建模】基于matlab GUI随机节点的生成树【含Matlab源码 1919期】

【图像处理基础】基于matlab GUI图像直方图均衡化系统【含Matlab源码 1924期】
![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]

Raspberry pie preliminary use
![[fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]](/img/e8/6342f2dc6e7f06a847852ce4b40719.jpg)
[fundamentals of image processing] GUI image curve adjustment system based on MATLAB [including Matlab source code 1923]

【图像处理基础】基于matlab GUI图像曲线调整系统【含Matlab源码 1923期】

YOLOv6:又快又准的目标检测框架开源啦

leetcode:710. 黑名单中的随机数【映射思维】

用C#通过sql语句操作Sqlserver数据库教程

VB. Net class library (Advanced - 2 overload)
随机推荐
VB. Net class library to obtain the color under the mouse in the screen (Advanced - 3)
Reading graph augmentations to learn graph representations (lg2ar)
vulnhub之dc8
Homebrew installation in MacOS environment [email protected]
Introduction to operator
【LeetCode】1984. Minimum difference between highest and lowest of K scores
Is this a bug? Whether the randomly filled letters can be closed
【混合编程jni 】第九篇之Jni总结
Operator介绍
DLA model (classification model + improved segmentation model) + deformable convolution
在哪家券商公司开户最方便最安全可靠
[hybrid programming JNI] details of JNA in Chapter 11
360 mobile assistant is the first to access the app signature service system to help distribute privacy and security
电子协会 C语言 1级 30 、 等差数列末项计算
Flashtext, a data cleaning tool, has directly increased the efficiency by dozens of times
从位图到布隆过滤器,C#实现
Some ways out for older programmers
【BUG反馈】WebIM在线聊天系统发消息时间问题
Brief analysis of the self inspection contents of the blue team in the attack and defense drill
Are there any risks for the top ten securities companies to register and open accounts? Is it safe?