计算 + ceil(改了三会啊)
2023-08-14 16:17:38
发布于:上海
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;//the amount of pencils
double a,b,c,d,e,f;//a,b,c refers to the amount of the pencils in the pocket
//d,e,f refers to the price of the kind of a pocket
cin>>a>>d>>b>>e>>c>>f;
double p1,p2,p3;
p1=ceil(n/a)*d;
p2=ceil(n/b)*e;
p3=ceil(n/c)*f;
cout<<int(min(min(p1,p2),p3));//cout the min price of the three boxes
return 0;
}
这里空空如也
有帮助,赞一个