#include <stdio.h>??int main(){ int a,b,x,t=1; printf("請輸入雞和兔子總數(shù):"); scanf("%d",&a); printf("請輸入雞和兔子腳的總數(shù):"); scanf("%d",&b); for(x=0;x<=a;x++) if(x*2+(a-x)*4==b) printf("有%d雞,%d兔子\n",x,a-x); t=0; if(t==1) printf("無解,輸入錯誤\n"); return 0;}?求指導(dǎo) ?這個程序哪錯了? 為什么運(yùn)行時不會出現(xiàn)無解?
C語言!雞兔同籠的程序
starfire1004
2016-06-17 00:09:49