正版题解
2026-09-22 20:29:59
发布于:江苏
1阅读
0回复
0点赞
一开始先加速
cout.tie(0);
cin.tie(0);
ios::sync_with_stdio(0);
接下来完整代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(0);//加速
short a,b,c;
cin>>a>>b>>c;//输入一开始三个数
short r[3]={a,b,c};//排序sort
sort(r,r+3);
a=r[0];
b=r[1];
c=r[2];
char s[3];//abc顺序
cin>>s;
if(s[0]=='A'){//判断
cout<<a;
}
if(s[0]=='B'){
cout<<b;
}
if(s[0]=='C'){
cout<<c;
}cout<<' ';
if(s[1]=='A'){
cout<<a;
}
if(s[1]=='B'){
cout<<b;
}
if(s[1]=='C'){
cout<<c;
}cout<<' ';
if(s[2]=='A'){
cout<<a;
}
if(s[2]=='B'){
cout<<b;
}
if(s[2]=='C'){
cout<<c;
}
return 0;
}
完成!
这里空空如也







有帮助,赞一个