求助帖,怎么提交错误啊
查看原帖
求助帖,怎么提交错误啊
420622
ROOKIEgod楼主2020/11/9 21:59
#include <iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int main() {
	int n, p, num,sum;
	double min = 100000000;
	int dai = 1;
	cin >> num;
	for (int i = 1; i < 4; i++) {
		cin >> n >> p;
		if (num % n != 0) dai = int (num / n )+ 1;
		sum = dai * p;		
		if (sum < min)
			min = sum;
	}
	cout << min;
	return 0;
}

2020/11/9 21:59
加载中...