大佬们帮忙看看我的鸡兔同笼问题在哪?
c4droid吧
全部回复
仅看楼主
level 1
错在哪,望大佬指点
2017年09月21日 10点09分 1
level 9
改一下
if(4*r +2*c == f)
{
printf("鸡数:%d,兔数:%d",c,r);
break;
}
同时你的程序没有无结果的情况。
2017年09月21日 13点09分 2
谢了
2017年09月21日 15点09分
谢了
2017年09月21日 15点09分
level 7
建议楼主注意一下空格,尽量让程序看起来好看一点。
还有,,,请尽量发程序代码,别发图。。。
2017年09月21日 13点09分 4
level 2
楼主你好,请问你的键盘怎么搞的,自定义吗
2017年09月22日 02点09分 5
level 4
#include <iostream>
using namespace std;
int main()
{
int ji, tu,h,t;
cout<<"请输入:"<<endl<<"头的数量";
cin>>h;
cout<<"腿的数量";
cin>>t;
for(tu=0;tu<=h;tu++)
{
ji=h-tu;
if(4*tu+2*ji==t)
break;}
cout<<"鸡的数量"<<ji<<"兔的数量"<<tu;
return 0;
}
2017年09月23日 14点09分 6
1