求救,30pts
查看原帖
求救,30pts
933437
Czenzi_QianXi楼主2024/8/21 22:23
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int x, y, z, n, m, cnt = 0;
    cin >> x >> y >> z >> n >> m;
    for(int i = 0; i * x <= n && i <= m; i++)
    {
        for(int j = 0; j * y + i * x <= n && i + j <= m; j++)
        {
            int k = (n - i * x - j * y) * z;
            if(i + j + k == n) cnt++;
        }
    }
    cout << cnt;
    return 0;
}
2024/8/21 22:23
加载中...