我想知哪错了
查看原帖
我想知哪错了
1360231
朱梓涵2012楼主2024/8/3 14:12
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,n1,n2,n3,p1,p2,p3,t1,t2,t3,total;
	cin>>n1>>p1>>n2>>p2>>n3>>p3;
	t1=!(n%n1) ?n/n1 *p1 :(n/n1+1)*p1;
	t2=!(n%n2) ?n/n2 *p2 :(n/n2+1)*p2;
	t3=!(n%n3) ?n/n3 *p3 :(n/n3+1)*p3;
	total=t1;
	if(t2<total)
	{
		total=t2;
	}
	if(t3<total)
	{
		total=t3;
	}
	cout<<total;
	return 0;
}

2024/8/3 14:12
加载中...