top1编程
← 返回题目
题解

【入门】采购水果

1 条题解

  • 0
    @ 2026-7-28 22:09:56
    #include<bits/stdc++.h> 
    using namespace std;
    
    int main(){
    	int x,y,n,s=0;
    	cin>>n>>x>>y;
    	for(int i=10;i<=n/x;i++){
    		for(int j=10;j<=n/y;j++){
    			if(i*x+y*j==n){
    				s++;
    		   	}
    		}			
    	}
    	cout<<s;
    	return 0;
    }
    
    • 1