34分,请问哪里错了,望指教
查看原帖
34分,请问哪里错了,望指教
1065349
封禁用户楼主2024/8/27 10:39
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a1,b1,c1,a2,b2,c2,x=0,y=0,z=0,x1=0,x2=0,x3=0;
	cin>>n>>a1>>a2>>b1>>b2>>c1>>c2;
	while(x<=n)
	{
		x+=a1;
		x1++;
	}
	x1*=a2;
	while(y<=n)
	{
		y+=b1;
		x2++;
	}
	x2*=b2;
	while(z<=n)
	{
		z+=c1;
		x3++;
	}
	x3*=c2;
	if(x1>=x2>=x3||x1>=x3>=x2)
	{
		cout<<x1;
	}
	else if(x2>=x1>=x3||x2>=x3>=x1)
	{
		cout<<x2;
	}
	else
	{
		cout<<x3;
	}
	return 0;
}
2024/8/27 10:39
加载中...