为啥我90分?
查看原帖
为啥我90分?
1633534
ding870123楼主2025/1/10 10:26
#include<bits/stdc++.h>
using namespace std;

int main(){
	int x,y,z,m,n,c,s=0;
	cin>>x>>y>>z>>n>>m;
	for(int a=0;a<=m/x;a++){
		for(int b=0;b<=m/y;b++){
			c=m-a-b;
			if(c%z==0){
					if(a*x+b*y+c/z==n)
						s++;
			}
		}
	}
	cout<<s;
	return 0;
}
2025/1/10 10:26
加载中...