解题:鸡兔同笼2
2023-08-03 22:46:10
发布于:广东
105阅读
0回复
0点赞
空降坐标:CP003056
请看代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    bool flag=true;
    for(int i=0;i<=x;i++)
    {
        int j=x-i;
        if(j*4+i*2==y)
        {
            cout<<"Yes";
            flag=false;
            break;
        }
    }
    if(flag)
    {
        cout<<"No";
    }
    return 0;
}
这里空空如也


有帮助,赞一个