源代码 #include<bits/stdc++.h> using namespace std; int main(){ //百钱百鸡 int cock,hen,chicken; for (cock=0;cock<=20;cock++)//控制公鸡数量 for(hen=0;hen<=30;hen++)//控制母鸡数量 for(chicken=0;chicken<=100;chicken++) { chicken=100-cock-hen; if(5*cock+3*hen+chicken/3.0==100) printf("cock=%2d,hen=%2d,chicken=%2d\n",cock,hen,chicken);}
标签:std,int,百钱,问题,百鸡,源代码,cock From: https://www.cnblogs.com/xuan-2004/p/17327336.html