题解 | #鸡兔同笼#
鸡兔同笼
https://www.nowcoder.com/practice/fda725b4d9a14010bb145272cababef1
#include <iostream>
using namespace std;
int main() {
int a;
while (cin >> a ) { // 注意 while 处理多个 case
// cout << a + b << endl;
if(a%2!=0){
cout<<"0 0"<<endl;
}else if(a%4==0){
cout<<a/4<<' '<<a/2<<endl;
}else{
cout<<a/4+1<<' '<<a/2<<endl;
}
}
}
// 64 位输出请用 printf("%lld")
联想公司福利 1493人发布
查看9道真题和解析