85分在怎么改都不行了,大佬帮帮我!
查看原帖
85分在怎么改都不行了,大佬帮帮我!
600687
lingkong楼主2021/10/30 11:07

代码

#include <iostream>
using namespace std;
int main()
{
	int a,b,c,d,e,f,g,h,i,j;
	cin>>a;
	cin>>b>>c;
	cin>>d>>e;
	cin>>f>>g;
	if(a%b!=0){
	h=(a/b+1)*c;
	}
	else if(a%b==0){
	h=(a/b)*c;
}
	if(a%d!=0){
	i=(a/d+1)*e;
	}
	else if(a%d==0) {
	
	i=(a/d)*e;
	}
	if(a%f!=0){
	
	i=(a/f+1)*g;
	}
	else if(a%f==0){
	
	j=(a/f)*g;
	}
	if(i<h){
	if(i<j){
		cout<<i;
	}else if(i>j){
		cout<<j;
}
}else if(h<j){
	cout<<h;
}else if(h>j){
	cout<<j;
}
	
	return 0;
 }
 
2021/10/30 11:07
加载中...