c++鸡兔同笼问题,

来源:互联网 发布:类似蜂窝的软件 编辑:程序博客网 时间:2024/06/01 08:15

c++鸡兔同笼问题,共有35个头,94个脚,问鸡和兔子各有多少只?


#include<bits/stdc++.h>

using namespace std;


int main()
{
    int a,b,x,y;
    a=35;b=94;
    x=2*a-b/2;
    y= b/2-1;
    cout<<"x="<<x<<" y="<<y<<endl;
    
    return 0;
}
0 0
原创粉丝点击