Run ID:160585
提交时间:2026-09-24 14:58:51
#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n) //多组输入 { for(int x=0;x<=20;x++) //最多20只大鸡 { for(int y=0;y<=33;y++) //最多33只y鸡 { int z = 100 - x - y; if(z < 0) continue; if(z % 3 != 0) continue; //z必须是3倍数 if(15*x +9*y + z <= 3*n ) //整数判断,无浮点数 { cout<<"x="<<x<<",y="<<y<<",z="<<z<<endl; } } } } return 0; }