Run ID:160586

提交时间:2026-09-24 15:00:02

#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n) //多组输入 { // x最多100,y最多100,z=100-x-y >=0 for(int x = 0; x <= 100; x++) { for(int y = 0; y <= 100; y++) { int z = 100 - x - y; if(z < 0) continue; // 总花费 5x+3y + z/3 <= n if(5*x + 3*y + z/3.0 <= n) { cout << "x=" << x << ",y=" << y << ",z=" << z << endl; } } } } return 0; }