#include

int Exhaustion(int foot,int head,int *chicken,int *rabbit)
{
 int i = 0;//chicken
 int j ;//rabbit
 int flag = 0;
 for(i=0;i  {
  j = head - i;
  if(foot == 2*i + 4*j)
  {
   flag = 1;
   *chicken = i;
   *rabbit = j;
  }
 }
 return flag;
}

void main()
{
 int foot,head,chicken,rabbit;
 int flag;

 printf("Please input foot number:\n");
 scanf("%d",&foot);
 printf("Please input head number:\n");
 scanf("%d",&head);

 flag = Exhaustion(foot,head,&chicken,&rabbit);

 if (flag == 1)
 {
  printf("Chicken:%d,Rabbit:%d\n",chicken,rabbit);
 }
 else
 {
  printf("No value\n");
 }
}