wo_onen1 @ 2024-09-28 22:28:01
谁能帮帮我!我不会写abc的排序!!!!求帮助!!!
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
char abc[3];
cin>>a>>b>>c;
for(int i=0;i<3;i++){
cin>>abc[i];
}
for(int i=0;i<3;i++){
if(abc[i]=='A'){
cout<<a;
}
if(abc[i]=='B'){
cout<<b;
}
if(abc[i]=='C'){
cout<<c;
}
cout<<" ";
}
return 0;
}
by zcy30 @ 2024-09-28 22:36:37
输入的顺序不是按照A,B,C的顺序来写的,得先排个序。懂了吗?
by wo_onen1 @ 2024-10-03 13:53:17
@zcy30 ok谢谢