helpmeplease @ 2024-10-08 11:28:17
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
int a[3];
string s;
cin>>a[0]>>a[1]>>a[2]>>s;
if((s[0]-s[1])*(a[0]-a[1])<0){
swap(a[0],a[1]);
}
if((s[1]-s[2])*(a[1]-a[2])<0){
swap(a[1],a[2]);
}
if((s[0]-s[1])*(a[0]-a[1])<0){
swap(a[0],a[1]);
}
cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" ";
return 0;
}
by helpmeplease @ 2024-10-08 14:23:20
最后一个换位搞错了。
by helpmeplease @ 2024-10-08 14:39:59
也不对,哪位大佬知道怎么换步骤数最少(这好像是数学题 (我直接CTRLcCTRLv6个if过了,但还是想知道怎么搞最好)
by helpmeplease @ 2024-10-13 15:55:19
推演了一下发现先02,再01和12可以
by helpmeplease @ 2024-10-13 15:55:53
好了不需要大佬出马了