View Code of Problem 87

#include<stdio.h>
int main(){
	int n;
	int a;
	scanf("%d",&n);
	if(n%2==1){
		printf("0 0");
	} else{

	//最多肯定都是鸡 
	//现在算最少 
	int c=n/4;//c表示兔的数量 
	int d=(n-c*4)/2;//表示鸡的数量 
	
	 
	printf("%d %d",c+d,n/2) ;
	
		}
	return 0;
} 

Double click to view unformatted code.


Back to problem 87