95分求助
查看原帖
95分求助
965137
emu_楼主2024/7/27 16:22
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long x,y,z,n,m,ans=0,small;
	cin>>x>>y>>z>>n>>m;
	for(int i=0;i<m;i++)//公 x
	{ 
		for(int j=0;j<m;j++)//母  y
		{
			small=(n-i*x-j*y)*z;
			if(small+i+j==m) ans++;
		} 
	}
	cout<<ans;
	return 0;
}
//n-i*x-j*y=小鸡的钱
 
2024/7/27 16:22
加载中...