作为一名新手, 不懂就问,大佬们,为何一分都没有,求解
查看原帖
作为一名新手, 不懂就问,大佬们,为何一分都没有,求解
627107
gu_tong楼主2022/3/8 21:47
#include<iostream>
using namespace std;
string str;
int main(){
	int a,max=-1,min=101,sum;
    for(int i=0;i<3;i++){
    	cin>>a;
    	if(max<a){
    		max=a;
		}
		if(min>a){
			min=a;
		}
		sum+=a;
	}
	sum=sum-min-max;
	cin>>str;
	if(str[0]=='A'){
		if(str[1]=='B'){
			cout<<min<<" "<<sum<<" "<<max;
		}else{
			cout<<min<<" "<<max<<" "<<sum;
		}
	}else if(str[0]=='B'){
		if(str[1]=='A'){
			cout<<sum<<" "<<min<<" "<<max;
		}else{
			cout<<sum<<" "<<max<<" "<<min;
		}
	}else if(str[0]=='C'){
		if(str[1]=='A'){
			cout<<max<<" "<<min<<" "<<sum;
		}else{
			cout<<max<<" "<<sum<<" "<<max;
		}
	}
    return 0;
}
2022/3/8 21:47
加载中...