a12345202303 @ 2024-08-18 13:44:37
#include<iostream>
#include<string>
using namespace std;
int a,b,c;
void huan(int &x,int &y){
int z;
if(x<y){
z=y;
y=x;
x=z;
}
}
void cou(string s,int b){
if(s[b-1]=='A'){
cout<<c<<" ";
}else if(s[b-1]=='B'){
cout<<b<<" ";
}else if(s[b-1]=='C'){
cout<<a<<" ";
}
}
int main(){
cin>>a>>b>>c;
huan(a,b);
huan(b,c);
huan(a,b);
string s;
cin>>s;
cou(s,1);
cou(s,2);
cou(s,3);
}
9 12 22
CBA
22 12 9
22 2 9
我曾试过以断点排除问题(VScode),在
by cosf @ 2024-08-18 13:51:35
变量名 b
重了。
by a12345202303 @ 2024-08-18 13:54:37
@cosf 谢谢,我试试
by a12345202303 @ 2024-08-18 13:55:30
@cosf 过了