[求助]请大侠们指教
有以下两个代码都是百钱百鸡问题, 一个是用for( ; ; )语句, 一个用while( ), 为什么就不能显示结果呢?请各位大侠指教,谢谢了. # include"stdio.h" main() { int x=0,y=0,z=0,j=0; printf("possible soluitions to buy 100 fowls whith 100 yunan \n"); for(x=0;x<=20;x++) for(y=0;y<=33;y++) { z=100-x-y; if(z%3==0&&5*x+3*y+z/3==100) printf("%2d:cock=%-2d hen=%-2d chicken=%-2d\n",++j,x,y,z); }
} # include"stdio.h" main() { int x=0,y=0,z=0,j=0; printf("possible soluitions to buy 100 fowls whith 100 yunan \n"); while(x<=20) { x++; while(y<=33) {y++; z=100-x-y; if(z%3==0&&5*x+3*y+z/3==100) printf("%2d:cock=%-2d hen=%-2d chicken=%-2d\n",++j,x,y,z); } }