90分求助
查看原帖
90分求助
1260455
WCW_LZM楼主2024/7/12 10:18
#include<bits/stdc++.h>
using namespace std;	
int main()
{
	int e[3];
	int a,b,c;
	char s,d,f;
	for(int i=0;i<3;i++)
	{
		cin>>e[i];
	}
	cin>>s>>d>>f;
	sort(e,e+3);
	a=e[0];
	b=e[1];
	c=e[2];
	if(s=='A'&&d=='B'&&f=='C')
		cout<<a<<" "<<b<<" "<<c;
	else if(s=='A'&&d=='C'&&f=='B')
		cout<<a<<" "<<c<<" "<<b;
	else if(s=='B'&&d=='A'&&f=='C') 
		cout<<b<<" "<<a<<" "<<c;
	else if(s=='B'&&d=='C'&&f=='A') 
		cout<<b<<" "<<c<<""<<a;
	else if(s=='C'&&d=='A'&&f=='B') 
		cout<<c<<" "<<a<<" "<<b;
	else
		cout<<c<<" "<<b<<" "<<a;		
		
	return 0;
}

2024/7/12 10:18
加载中...