当前位置:网站首页>[summer daily question] Luogu p4414 [coci2006-2007 2] ABC
[summer daily question] Luogu p4414 [coci2006-2007 2] ABC
2022-07-29 07:28:00 【AC_ Dragon】
Topic link :P4414 [COCI2006-2007#2] ABC - Luogu | New ecology of computer science education (luogu.com.cn)
Topic translation
【 Title Description 】
The three integers are A,B,C. These three numbers will not be given to you in this order , But they always meet the conditions :A < B < C. In order to look more concise , We hope you can rearrange them in the given order .
【 Input format 】
The first line contains three positive integers A,B,C, Not necessarily in this order . All three numbers are less than or equal to 100. The second line contains three capital letters A、B and C( Between them No, Space ) Indicates the desired order .
【 Output format 】
Output in one line A,B and C, Use one ( Space ) separate .
thank @smartzzh Translation provided
Title Description
You will be given three integers A, B and C. The numbers will not be given in that exact order, but we do know that A is less than B and B less than C.
In order to make for a more pleasant viewing, we want to rearrange them in the given order.
Input format
The first line contains three positive integers A, B and C, not necessarily in that order. All three numbers will be less than or equal to 100.
The second line contains three uppercase letters 'A', 'B' and 'C' (with no spaces between them) representing the desired order.
Output format
Output the A, B and C in the desired order on a single line, separated by single spaces.
Examples #1
The sample input #1
1 5 3
ABCSample output #1
1 3 5Examples #2
The sample input #2
6 4 2
CABSample output #2
6 2 4AC code:
#include<iostream>
#include<algorithm>
using namespace std;
int n[3];
int main()
{
cin>>n[0]>>n[1]>>n[2];
sort(n,n+3);
int a=n[0];
int b=n[1];
int c=n[2];
string s;
cin>>s;
for(auto i:s)
{
if(i=='A')
cout<<n[0]<<" ";
if(i=='B')
cout<<n[1]<<" ";
if(i=='C')
cout<<n[2]<<" ";
}
return 0;
} 边栏推荐
- 树莓派的启动流程
- 我想问一下,我flink作业是以upsert-kafka的方式写入数据的,但是我在mysql里面去更
- Introduction to logback appender
- 使用自定义注解校验list的大小
- 08 dynamic programming
- Description of rollingfileappender attribute in logback
- QT连接两个qslite数据库报错QSqlQuery::exec: database not open
- 用户列表 圆形头像并跟随小板块
- @RequestMapping 用法详解
- 我,28岁,测试员,10月无情被辞:想给还在学测试 的人提个醒......
猜你喜欢

Section 7 - compilation of programs (preprocessing operations) + links

我,28岁,测试员,10月无情被辞:想给还在学测试 的人提个醒......

论文阅读 (62):Pointer Networks

如何与斯堪尼亚SCANIA建立EDI连接?

gcc/g++的使用

CMOS芯片制造全工艺流程

thinkphp6 实现数据库备份

SpingBoot整合Quartz框架实现动态定时任务(支持实时增删改查任务)

WPF simple login page completion case

1 - background project construction
随机推荐
国内数字藏品的乱象与未来
Ethernet interface introduction
7-2 calculate the area and perimeter of a regular pentagon (25 points)
BeanUtils.setProperty()
[daily question in summer] Luogu p6408 [coci2008-2009 3] pet
梳理市面上的2大NFT定价范式和4种解决方案
BeanUtils.setProperty()
使用自定义注解校验list的大小
Can I specify memory parameters in SQL statements?
Synchronous / asynchronous, blocking / non blocking and IO
受欢迎的牛 G
Gin parameter validation
Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
WPF simple login page completion case
Introduction to log4j layout
0 9 布隆过滤器(Bloom Filter)
Reflect reflect
Does Flink support sqlserver databases? Get the changes of SQLSERVER database
QT topic: basic components (button class, layout class, output class, input class, container class)
Variables and encryption in ansible