求助,为啥vs没问题,在这就不通过呀
查看原帖
求助,为啥vs没问题,在这就不通过呀
1442555
sswds8888楼主2024/9/17 12:09
#include<iostream>
using namespace std;
int main()
{
    int n, n1, n2, n3, p1, p2, p3, c1, c2, c3, c;
    cin >> n >> n1 >> p1 >> n2 >> p2 >> n3 >> p3;
    c1 = !(n / n1) ? n / n1 * p1 : (n / n1 + 1) * p1;
    c2 = !(n / n2) ? n / n2 * p2 : (n / n2 + 1) * p2;
    c3 = !(n / n3) ? n / n3 * p3 : (n / n3 + 1) * p3;
    if (c1 < c2 && c1 < c3)c = c1;
    if (c2 < c1 && c2 < c3)c = c2;
    if (c3 < c1 && c3 < c2)c = c3;
    cout << c << endl;
    return 0;
}
2024/9/17 12:09
加载中...