求调,输出2对不上
查看原帖
求调,输出2对不上
1388115
_Monody_楼主2024/7/18 09:53
#include<bits/stdc++.h>
using namespace std;
int main() {
	double a,b,c,d,e,l1,l2,l3;
	int x,y;
	cin>>a>>b>>c>>d>>e>>x>>y;
	l1=((a*x)+(b*y))*1.0;
	l2=(c*y)*1.0;
	l3=(d*y+e)*1.0;
	if (l1>l2&&l1>l3){
		cout<<1<<" ";
		cout<<fixed<<setprecision(2)<<l1;
	};
	if(l2>l1&&l2>l3){
		cout<<2<<" ";
		cout<<fixed<<setprecision(2)<<l2;
	};
	if(l3>l2&&l3>l1){
		cout<<3<<" ";
		cout<<fixed<<setprecision(2)<<l3; 
	};
	if(l1==l2||l1==l3||l2==l3||l1==l2&&l1==l3){
		cout<<1<<" ";
		cout<<fixed<<setprecision(2)<<l1;
	};
	return 0;
}
2024/7/18 09:53
加载中...