题解 | #鸡兔同笼#
鸡兔同笼
https://www.nowcoder.com/practice/fda725b4d9a14010bb145272cababef1
#include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int a; while (scanf("%d", &a) != EOF) { int min; int max; if (a % 2 == 1) { //奇数 printf("0 0\n"); return 0; } else { min = a / 4 + (a % 4) / 2; max = a / 2; printf("%d %d", min, max); } } return 0; }