A378.鸡兔同笼题解
2026-02-10 12:32:08
发布于:四川
7阅读
0回复
0点赞
A378.鸡兔同笼
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m; // 代表头数和脚数
cin >> n >> m;
int x = (m - n * 2) / 2; // 鸡的个数
int y = n - x; // 兔的脚数
cout << y << endl << x;
return 0;//好习惯
}
这里空空如也






有帮助,赞一个